mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 13:33:02 +01:00
Fix #20628: Stop caret left moving off the input string
This commit is contained in:
@@ -276,7 +276,8 @@ void TextComposition::CaretMoveToLeftToken()
|
||||
lastChar = selectionOffset;
|
||||
break;
|
||||
}
|
||||
|
||||
if (selectionOffset == 0)
|
||||
break;
|
||||
ch--;
|
||||
selectionOffset--;
|
||||
}
|
||||
@@ -295,12 +296,13 @@ void TextComposition::CaretMoveToLeftToken()
|
||||
break;
|
||||
|
||||
lastChar = selectionOffset;
|
||||
|
||||
if (selectionOffset == 0)
|
||||
break;
|
||||
ch--;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user