fix(color): Fix top bar timer widget names sometimes having garbage characters (#2835)

Limit length of name text drawn in small size timer widget to prevent random characters appearing
This commit is contained in:
philmoz
2022-12-10 15:48:36 +10:00
committed by GitHub
parent 2a882c8499
commit d4cd3d0ddf
+1 -1
View File
@@ -112,7 +112,7 @@ class TimerWidget : public Widget
}
// name
if (ZLEN(timerData.name) > 0) { // user name exist
dc->drawText(2, 0, timerData.name, FONT(XS) | COLOR_THEME_PRIMARY2);
dc->drawSizedText(2, 0, timerData.name, LEN_TIMER_NAME, FONT(XS) | COLOR_THEME_PRIMARY2);
} else { // user name not exist "TMRn"
drawStringWithIndex(dc, 2, 0, "TMR", index + 1,
FONT(XS) | COLOR_THEME_PRIMARY2);