Static now accepts right aligned text

This commit is contained in:
Bertrand Songis
2020-01-07 10:23:39 +01:00
parent b1a52977a2
commit 60d4ba17cd
Vendored Regular → Executable
+2
View File
@@ -26,6 +26,8 @@ void StaticText::paint(BitmapBuffer * dc)
dc->drawSolidFilledRect(0, 0, rect.w, rect.h, DISABLE_COLOR);
if (textFlags & CENTERED)
dc->drawText(rect.w / 2, (1 + rect.h - getFontHeight(textFlags)) / 2, text.c_str(), textFlags);
else if (textFlags & RIGHT)
dc->drawText(rect.w, FIELD_PADDING_TOP, text.c_str(), textFlags);
else
dc->drawText(0, 0 + FIELD_PADDING_TOP, text.c_str(), textFlags);
}