mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +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();
|
||||
float referenceSize;
|
||||
|
||||
if (mAlignRight) {
|
||||
if (mTime != 0)
|
||||
referenceSize = font->sizeText("ABCDEFG").x();
|
||||
else
|
||||
referenceSize = font->sizeText("ABCDEIJ").x();
|
||||
}
|
||||
|
||||
// Vertically center.
|
||||
Vector3f off(0, (mSize.y() - mTextCache->metrics.size.y()) / 2.0f, 0.0f);
|
||||
|
|
Loading…
Reference in a new issue