Fixed an issue where pasting text into a text edit field would make the cursor jump to an incorrect position

This commit is contained in:
Leon Styhre 2024-11-12 19:52:47 +01:00
parent bdd93d86ea
commit 1a4648622a

View file

@ -128,7 +128,8 @@ void TextEditComponent::textInput(const std::string& text, const bool pasting)
(pasting && !mMultiLine ? Utils::String::replace(text, "\n", " ") : text));
mCursor += static_cast<unsigned int>(
(pasting && !mMultiLine ? Utils::String::replace(text, "\n", " ") : text).size());
++mCursorShapedText;
mCursorShapedText += static_cast<unsigned int>(Utils::String::unicodeLength(
(pasting && !mMultiLine ? Utils::String::replace(text, "\n", " ") : text)));
}
}