INVERS flag removed and VCENTERED added
This commit is contained in:
+1
-1
@@ -26,8 +26,8 @@
|
||||
#define BLINK 0x01u
|
||||
|
||||
/* drawText flags */
|
||||
#define INVERS 0x02u
|
||||
#define LEFT 0x00u /* align left */
|
||||
#define VCENTERED 0x02u /* align center vertically */
|
||||
#define CENTERED 0x04u /* align center */
|
||||
#define RIGHT 0x08u /* align right */
|
||||
#define SHADOWED 0x80u /* black copy at +1 +1 */
|
||||
|
||||
+11
-4
@@ -22,12 +22,19 @@
|
||||
|
||||
void StaticText::paint(BitmapBuffer * dc)
|
||||
{
|
||||
if (windowFlags & BUTTON_BACKGROUND)
|
||||
if (windowFlags & BUTTON_BACKGROUND) {
|
||||
dc->drawSolidFilledRect(0, 0, rect.w, rect.h, DISABLE_COLOR);
|
||||
}
|
||||
|
||||
coord_t x;
|
||||
if (textFlags & CENTERED)
|
||||
dc->drawText(rect.w / 2, 1 + (rect.h - getFontHeight(textFlags)) / 2, text.c_str(), textFlags);
|
||||
x = rect.w / 2;
|
||||
else if (textFlags & RIGHT)
|
||||
dc->drawText(rect.w, FIELD_PADDING_TOP, text.c_str(), textFlags);
|
||||
x = rect.w;
|
||||
else
|
||||
dc->drawText(0, 0 + FIELD_PADDING_TOP, text.c_str(), textFlags);
|
||||
x = 0;
|
||||
|
||||
coord_t y = (textFlags & VCENTERED) ? (rect.h - getFontHeight(textFlags)) / 2 : FIELD_PADDING_TOP;
|
||||
|
||||
dc->drawText(x, y, text.c_str(), textFlags);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user