set text width ahead of width calculation
This commit is contained in:
1 parent
1bc94c2ec3
commit
42ef297241
1 file changed
+1
-1
@@ -163,9 +163,9 @@ void UITask::renderCurrScreen() {
|
||||
|
||||
char tmp[80];
|
||||
if (_alert[0]) {
|
||||
_display->setTextSize(1.4);
|
||||
uint16_t textWidth = _display->getTextWidth(_alert);
|
||||
_display->setCursor((_display->width() - textWidth) / 2, 22);
|
||||
_display->setTextSize(1.4);
|
||||
_display->setColor(DisplayDriver::GREEN);
|
||||
_display->print(_alert);
|
||||
_alert[0] = 0;
|
||||
|
||||
Reference in new issue
Block a user