1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix #7020: end key not working in text input.

This commit is contained in:
Aaron van Geffen
2018-02-23 15:04:51 +01:00
parent dcde4f1edc
commit 88cfd14ce5

View File

@@ -194,7 +194,15 @@ void TextComposition::CursorHome()
void TextComposition::CursorEnd()
{
_session.SelectionStart = _session.SelectionSize;
size_t selectionOffset = _session.Size;
const utf8 * ch = _session.Buffer + _session.SelectionStart;
while (!utf8_is_codepoint_start(ch) && selectionOffset > 0)
{
ch--;
selectionOffset--;
}
_session.SelectionStart = selectionOffset;
}
void TextComposition::CursorLeft()