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:
Bertrand Songis
2019-06-08 10:42:29 +02:00
committed by GitHub
parent a3cc0ee830
commit 56a31f20d3
10 changed files with 144 additions and 57 deletions
+5 -1
View File
@@ -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