Menu black overlay fix (need to give the pointer of the current window)
This commit is contained in:
+3
-3
@@ -33,10 +33,10 @@ void TextEdit::paint(BitmapBuffer * dc)
|
||||
dc->drawSizedText(FIELD_PADDING_LEFT, FIELD_PADDING_TOP, value, length, FOCUS_COLOR);
|
||||
coord_t left = (cursorPos == 0 ? 0 : getTextWidth(value, cursorPos));
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
dc->drawSolidFilledRect(left + 2, FIELD_PADDING_TOP + 1, 2, 20, FOCUS_COLOR);
|
||||
dc->drawSolidFilledRect(left + 2, 2, 2, height() - 4, FOCUS_COLOR);
|
||||
#else
|
||||
char s[] = { value[cursorPos], '\0' };
|
||||
dc->drawSolidFilledRect(FIELD_PADDING_LEFT + left - 1, FIELD_PADDING_TOP + 1, getTextWidth(s, 1) + 1, height() - 2, FOCUS_COLOR);
|
||||
dc->drawSolidFilledRect(FIELD_PADDING_LEFT + left - 1, FIELD_PADDING_TOP - 1, getTextWidth(s, 1) + 1, height() - 2, FOCUS_COLOR);
|
||||
dc->drawText(FIELD_PADDING_LEFT + left, FIELD_PADDING_TOP, s, DEFAULT_COLOR);
|
||||
#endif
|
||||
}
|
||||
@@ -193,7 +193,7 @@ bool TextEdit::onTouchEnd(coord_t x, coord_t y)
|
||||
char c = value[cursorPos];
|
||||
if (c == '\0')
|
||||
break;
|
||||
uint8_t w = getCharWidth(c, fontspecsTable[0]);
|
||||
uint8_t w = getCharWidth(c, fontspecsTable[0]) + 1;
|
||||
if (rest < w)
|
||||
break;
|
||||
rest -= w;
|
||||
|
||||
Reference in New Issue
Block a user