GUI: Always mark editable as dirty when press home or end

- Before, the implementation used to fetch this value based on setCaretPos.
- That would return true only if string needed scrolling.
- Thus, the small issue arised that 2 chars would be wobbled together. This commit fixes that.
This commit is contained in:
aryanrawlani28 2020-07-23 03:05:58 +05:30 committed by Eugene Sandulenko
parent ed71d58b55
commit 2a239efa80

View file

@ -163,8 +163,9 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) {
case Common::KEYCODE_DOWN: case Common::KEYCODE_DOWN:
case Common::KEYCODE_END: case Common::KEYCODE_END:
// Move caret to end // Move caret to end
dirty = setCaretPos(_editString.size()); setCaretPos(_editString.size());
forcecaret = true; forcecaret = true;
dirty = true;
break; break;
case Common::KEYCODE_LEFT: case Common::KEYCODE_LEFT:
@ -188,8 +189,9 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) {
case Common::KEYCODE_UP: case Common::KEYCODE_UP:
case Common::KEYCODE_HOME: case Common::KEYCODE_HOME:
// Move caret to start // Move caret to start
dirty = setCaretPos(0); setCaretPos(0);
forcecaret = true; forcecaret = true;
dirty = true;
break; break;
case Common::KEYCODE_v: case Common::KEYCODE_v: