1. fixed checkbox focus on touch

2. fixed crash if you edit a textbox and close the simu.  TextEdit changeEnd() wasnt checking lvgl for validity
3. removed dead code in new TextEdit onTouchEnd()
This commit is contained in:
kevinkoenig
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent 0429341528
commit 6a8707fb69
4 changed files with 31 additions and 12 deletions
+12 -11
View File
@@ -261,18 +261,19 @@ bool TextEdit::onTouchEnd(coord_t x, coord_t y)
TextKeyboard::show(this);
#endif
coord_t rest = x;
for (cursorPos = 0; cursorPos < length; cursorPos++) {
char c = value[cursorPos];
if (c == '\0')
break;
uint8_t w = getCharWidth(c, fontspecsTable[0]) + 1;
if (rest < w)
break;
rest -= w;
}
// coord_t rest = x;
// for (cursorPos = 0; cursorPos < length; cursorPos++) {
// char c = value[cursorPos];
// if (c == '\0')
// break;
// uint8_t w = getCharWidth(c, fontspecsTable[0]) + 1;
// if (rest < w)
// break;
// rest -= w;
// }
// invalidate();
invalidate();
return true;
}
#endif