Widgets/TextAreaWidget: Fix clipboard paste cursor with non-ascii chars

This commit is contained in:
SirLynix 2024-02-06 13:28:08 +01:00
parent 99952db736
commit d3f7e20473
1 changed files with 1 additions and 1 deletions

View File

@ -304,7 +304,7 @@ namespace Nz
void TextAreaWidget::PasteFromClipboard(const Vector2ui& targetPosition)
{
std::size_t glyphCount = ComputeCharacterCount(m_text);
std::size_t targetIndex = GetCharacterPosition(m_text, std::min(GetGlyphIndex(targetPosition), glyphCount));
std::size_t targetIndex = std::min(GetGlyphIndex(targetPosition), glyphCount);
std::string clipboardString = Clipboard::GetString();
if (clipboardString.empty())