mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 16:15:39 +00:00
Eliminated some unnecessary processing in DateTimeEditComponent if not right aligning.
This commit is contained in:
parent
552368d2f6
commit
e3f67b26c3
|
@ -165,10 +165,12 @@ void DateTimeEditComponent::render(const Transform4x4f& parentTrans)
|
||||||
std::shared_ptr<Font> font = getFont();
|
std::shared_ptr<Font> font = getFont();
|
||||||
float referenceSize;
|
float referenceSize;
|
||||||
|
|
||||||
|
if (mAlignRight) {
|
||||||
if (mTime != 0)
|
if (mTime != 0)
|
||||||
referenceSize = font->sizeText("ABCDEFG").x();
|
referenceSize = font->sizeText("ABCDEFG").x();
|
||||||
else
|
else
|
||||||
referenceSize = font->sizeText("ABCDEIJ").x();
|
referenceSize = font->sizeText("ABCDEIJ").x();
|
||||||
|
}
|
||||||
|
|
||||||
// Vertically center.
|
// Vertically center.
|
||||||
Vector3f off(0, (mSize.y() - mTextCache->metrics.size.y()) / 2.0f, 0.0f);
|
Vector3f off(0, (mSize.y() - mTextCache->metrics.size.y()) / 2.0f, 0.0f);
|
||||||
|
|
Loading…
Reference in a new issue