mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Fixed text editing for multi-byte characters.
This commit is contained in:
parent
c4d0e0229e
commit
531fb50e01
|
@ -60,12 +60,13 @@ void TextEditComponent::textInput(const char* text)
|
|||
{
|
||||
if(mCursor > 0)
|
||||
{
|
||||
mText.erase(mText.begin() + mCursor - 1, mText.begin() + mCursor);
|
||||
mCursor--;
|
||||
size_t newCursor = Font::getPrevCursor(mText, mCursor);
|
||||
mText.erase(mText.begin() + newCursor, mText.begin() + mCursor);
|
||||
mCursor = newCursor;
|
||||
}
|
||||
}else{
|
||||
mText.insert(mCursor, text);
|
||||
mCursor++;
|
||||
mCursor += strlen(text);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue