selection bug fix attempt

This commit is contained in:
thrust26 2020-11-05 08:26:59 +01:00
parent c894d8c080
commit 5fd48d8a99
1 changed files with 2 additions and 0 deletions

View File

@ -52,6 +52,7 @@ void EditableWidget::setText(const string& str, bool)
_editString.push_back(c);
_caretPos = int(_editString.size());
_selectSize = 0;
_editScrollOffset = (_font.getStringWidth(_editString) - (getEditRect().w()));
if (_editScrollOffset < 0)
@ -101,6 +102,7 @@ bool EditableWidget::handleText(char text)
if(tryInsertChar(text, _caretPos))
{
_caretPos++;
_selectSize = 0;
sendCommand(EditableWidget::kChangedCmd, 0, _id);
setDirty();
return true;