drawText(..., RIGHT) will now return the text left position
This commit is contained in:
+1
-1
@@ -463,7 +463,7 @@ coord_t BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_
|
|||||||
|
|
||||||
RESTORE_OFFSET();
|
RESTORE_OFFSET();
|
||||||
|
|
||||||
return pos - offsetX;
|
return ((flags & RIGHT) ? orig_pos : pos) - offsetX;
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t BitmapBuffer::drawNumber(coord_t x, coord_t y, int32_t val, LcdFlags flags, uint8_t len, const char * prefix, const char * suffix)
|
coord_t BitmapBuffer::drawNumber(coord_t x, coord_t y, int32_t val, LcdFlags flags, uint8_t len, const char * prefix, const char * suffix)
|
||||||
|
|||||||
+5
-2
@@ -92,8 +92,8 @@ class Table: public Window {
|
|||||||
public:
|
public:
|
||||||
Table(Window * parent, const rect_t & rect, uint8_t columnsCount):
|
Table(Window * parent, const rect_t & rect, uint8_t columnsCount):
|
||||||
Window(parent, rect),
|
Window(parent, rect),
|
||||||
header(this, {0, 0, width(), TABLE_HEADER_HEIGHT}),
|
header(this, {0, 0, width(), 0}),
|
||||||
body(this, {0, TABLE_HEADER_HEIGHT, width(), height() - TABLE_HEADER_HEIGHT})
|
body(this, {0, 0, width(), height()})
|
||||||
{
|
{
|
||||||
setColumnsCount(columnsCount);
|
setColumnsCount(columnsCount);
|
||||||
}
|
}
|
||||||
@@ -131,6 +131,9 @@ class Table: public Window {
|
|||||||
|
|
||||||
void setHeader(const char * const values[])
|
void setHeader(const char * const values[])
|
||||||
{
|
{
|
||||||
|
header.setHeight(TABLE_HEADER_HEIGHT);
|
||||||
|
body.setTop(TABLE_HEADER_HEIGHT);
|
||||||
|
body.setHeight(height() - TABLE_HEADER_HEIGHT);
|
||||||
Line line;
|
Line line;
|
||||||
for (uint8_t i = 0; i < count; i++) {
|
for (uint8_t i = 0; i < count; i++) {
|
||||||
line.values.push_back(values[i]);
|
line.values.push_back(values[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user