Fix rich textbox carret placement regressions

#3118 #2964
This commit is contained in:
Wojtek Figat
2025-03-08 23:49:12 +01:00
parent fe95ac96af
commit 1e2e613a78
2 changed files with 34 additions and 21 deletions

View File

@@ -388,11 +388,11 @@ int32 Font::HitTestText(const StringView& text, const Float2& location, const Te
if (dst < smallestDst)
{
// Pointer is behind the last character in the line
smallestIndex = line.LastCharIndex;
smallestIndex = line.LastCharIndex + 1;
// Fix for last line
if (lineIndex == lines.Count() - 1)
smallestIndex++;
//if (lineIndex == lines.Count() - 1)
// smallestIndex++;
}
return smallestIndex;