mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #20628: Stop caret left moving off the input string
This commit is contained in:
parent
00b5932557
commit
33523c98c2
|
@ -4,6 +4,7 @@
|
||||||
- Improved: [#20951] Activate OpenRCT2 window after using native file dialog on macOS.
|
- Improved: [#20951] Activate OpenRCT2 window after using native file dialog on macOS.
|
||||||
- Fix: [#20255] Images from the last hovered-over coaster in the object selection are not freed.
|
- Fix: [#20255] Images from the last hovered-over coaster in the object selection are not freed.
|
||||||
- Fix: [#20616] Confirmation button in the track designer’s quit prompt has the wrong text.
|
- Fix: [#20616] Confirmation button in the track designer’s quit prompt has the wrong text.
|
||||||
|
- Fix: [#20628] Moving caret using Ctrl+left can move too far when using a multibyte grapheme.
|
||||||
- Fix: [#21145] [Plugin] setInterval/setTimeout handle conflict.
|
- Fix: [#21145] [Plugin] setInterval/setTimeout handle conflict.
|
||||||
- Fix: [#21157] [Plugin] Widgets do not redraw correctly when updating disabled or visibility state.
|
- Fix: [#21157] [Plugin] Widgets do not redraw correctly when updating disabled or visibility state.
|
||||||
- Fix: [#21158] [Plugin] Potential crash using setInterval/setTimeout within the callback.
|
- Fix: [#21158] [Plugin] Potential crash using setInterval/setTimeout within the callback.
|
||||||
|
|
|
@ -276,7 +276,8 @@ void TextComposition::CaretMoveToLeftToken()
|
||||||
lastChar = selectionOffset;
|
lastChar = selectionOffset;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (selectionOffset == 0)
|
||||||
|
break;
|
||||||
ch--;
|
ch--;
|
||||||
selectionOffset--;
|
selectionOffset--;
|
||||||
}
|
}
|
||||||
|
@ -295,12 +296,13 @@ void TextComposition::CaretMoveToLeftToken()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
lastChar = selectionOffset;
|
lastChar = selectionOffset;
|
||||||
|
if (selectionOffset == 0)
|
||||||
|
break;
|
||||||
ch--;
|
ch--;
|
||||||
selectionOffset--;
|
selectionOffset--;
|
||||||
}
|
}
|
||||||
|
|
||||||
_session.SelectionSize = std::max<size_t>(0, _session.SelectionSize - (selectionOffset - _session.SelectionStart));
|
_session.SelectionSize = _session.SelectionSize - (selectionOffset - _session.SelectionStart);
|
||||||
_session.SelectionStart = selectionOffset == 0 ? 0 : lastChar;
|
_session.SelectionStart = selectionOffset == 0 ? 0 : lastChar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue