cleanup static paint routine
This commit is contained in:
committed by
Raphael Coeffic
parent
fe0f5b8490
commit
52cab6fd7c
-34
@@ -20,37 +20,3 @@
|
||||
#include "static.h"
|
||||
#include "font.h"
|
||||
|
||||
void StaticText::paint(BitmapBuffer * dc)
|
||||
{
|
||||
// if (bgColor) {
|
||||
// dc->drawSolidFilledRect(0, 0, rect.w, rect.h, bgColor);
|
||||
// }
|
||||
|
||||
// coord_t x;
|
||||
// if (textFlags & CENTERED)
|
||||
// x = rect.w / 2;
|
||||
// else if (textFlags & RIGHT)
|
||||
// x = rect.w;
|
||||
// else
|
||||
// x = 0;
|
||||
|
||||
// coord_t y = (textFlags & VCENTERED) ? (rect.h - getFontHeight(textFlags)) / 2
|
||||
// : FIELD_PADDING_TOP;
|
||||
|
||||
// auto start = text.c_str();
|
||||
// auto nextline = findNextLine(start);
|
||||
// if (nextline) {
|
||||
// auto current = start;
|
||||
// do {
|
||||
// dc->drawText(x, y,
|
||||
// text.substr(current - start, nextline - current).c_str(),
|
||||
// textFlags);
|
||||
// current = nextline + 1;
|
||||
// nextline = findNextLine(current);
|
||||
// y += getFontHeight(textFlags) + 2;
|
||||
// } while (nextline);
|
||||
// dc->drawText(x, y, current, textFlags);
|
||||
// } else {
|
||||
// dc->drawText(x, y, start, textFlags);
|
||||
// }
|
||||
}
|
||||
|
||||
-3
@@ -55,14 +55,11 @@ class StaticText: public Window
|
||||
}
|
||||
#endif
|
||||
|
||||
void paint(BitmapBuffer * dc) override;
|
||||
|
||||
void setText(std::string value)
|
||||
{
|
||||
if (text != value) {
|
||||
text = std::move(value);
|
||||
lv_label_set_text(label, this->text.c_str());
|
||||
// invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user