Skip to content

Conversation

@aggniesz
Copy link
Contributor

When trying to move Text Editor’s caret to the end of the last line of the text, it was being set one character to the left of the last whitespace character.

getGlyphIndexToTheRightOf is now reporting an invalid index for trailing whitespaces (as there’s nothing to the right of it), and the last character’s index for newline characters.

Also fixes newline characters not being detected correctly due to removing all control characters during string sanitising in SimpleShapedText’s constructor.

The input string was sanitised in constructor, resulting in stored string never containing any control characters.
The function was reporting the whitespace glyph's index instead of the index to the right of it.
@reuk
Copy link
Member

reuk commented Oct 21, 2025

Thanks, I've pushed these changes with a few tweaks:

3a0135f

e525e12

@reuk reuk closed this Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants