-
Notifications
You must be signed in to change notification settings - Fork 237
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
In a multi-line paragraph how to highlight the line the caret is on? #841
Comments
I've now implemented this but using a different method. I'm listening to the caret bounds and then drawing and positioning a Pane behind the area for the bounds position. Thus:
This produces something like the following: Note: sometimes the caret bounds aren't present. While this works, it would be nice to have an "in area" method of doing this. This type of feature is common in writing applications and code editors. |
That's a good hack :-) I've had a look at this and I'm planning on adding the following API to setLineHighlighterFill( Color highlight )
setLineHighlighterOn( boolean show )
isLineHighlighterOn()
getCurrentLineStartInParargraph()
getCurrentLineEndInParargraph() Any thoughts or comments welcome. |
That would be some great additions. It might be better to have a Paint rather than a Color though, for those who want to do something a little fancier. The only problem with my workaround is that I'm now seeing this problem #842. |
RichTextFX 0.10.2 has been released with this feature. |
I'm wanting to have the line the caret is currently on be highlighted. I've asked this before #611 but a lot has changed since I first asked and now I'm thinking of doing:
Would this approach work?
The main issue I can see is that there doesn't seem to be any way to get the text offsets of the start and end of the line. Is there any way to get those offsets?
The text was updated successfully, but these errors were encountered: