mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20:15: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)
|
if(mCursor > 0)
|
||||||
{
|
{
|
||||||
mText.erase(mText.begin() + mCursor - 1, mText.begin() + mCursor);
|
size_t newCursor = Font::getPrevCursor(mText, mCursor);
|
||||||
mCursor--;
|
mText.erase(mText.begin() + newCursor, mText.begin() + mCursor);
|
||||||
|
mCursor = newCursor;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
mText.insert(mCursor, text);
|
mText.insert(mCursor, text);
|
||||||
mCursor++;
|
mCursor += strlen(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue