-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cursor at the end of the Text #78
Comments
@arpu You should use the utility functions for caret and selection positioning described here: https://github.com/protectwise/troika/blob/master/packages/troika-three-text/README.md#carets-and-selection-ranges Something like: add a listener for the And then of course as you improve your text editor you can get caret positions at any place within the string as well. And selection rects too. :) |
wau, thx for your fast response! this works fantastic! |
@lojjic not sure if this is a bug or a problem on my side, but the getSelectionRects is not updated for a space in the first Line Peek.2021-02-17.15-42.mp4 |
all works fine in the second line i get the right position with
|
Hmm, it looks like getSelectionRects clips the rects to the overall bounds of the rendered glyphs, which may explain what you're seeing. I'll have to give some thought to whether that's the behavior we want or not (I think probably not, but need to make sure.) In the meantime, you could maybe work around it by accessing textRenderInfo.caretPositions directly? |
…hitespace Fixes issue described in #78. We were clipping to the blockBounds, which broke caret positioning for trailing whitespace. Removed that clipping and added a different fix for overly wide trailing whitespace characters when justifying.
@arpu I've just released a 0.39.1 patch version which I think should fix your issue. Please let me know whether it works. |
@lojjic wau! this fixed it for me! thx a lot for fast response! |
Hey,
working on a basic Cursor blinking at the End of the Text, any Idea what i should do if the maxWidth wrap the Text?
( using totalBlockSize )
( attached small showcast Video)
The text was updated successfully, but these errors were encountered: