Bsongis/radio tools (#6484)
Lua tools now displayed in RADIO / TOOLS Add a function to write CENTERED text with lcdDrawText
This commit is contained in:
@@ -268,6 +268,10 @@ void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlag
|
||||
width = getTextWidth(s, len, flags);
|
||||
x -= width;
|
||||
}
|
||||
else if (flags & CENTERED) {
|
||||
width = getTextWidth(s, len, flags);
|
||||
x -= width / 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
while (len--) {
|
||||
@@ -417,7 +421,7 @@ void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags flags, uint8_t le
|
||||
if (neg) {
|
||||
*--s = '-';
|
||||
}
|
||||
flags &= ~LEADING0;
|
||||
flags &= ~(LEADING0 | PREC1 | PREC2);
|
||||
lcdDrawText(x, y, s, flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user