fixed caret positioning in wrapped lines (issue #423)#572
fixed caret positioning in wrapped lines (issue #423)#572JordanMartinez merged 2 commits intoFXMisc:masterfrom
Conversation
|
|
||
| TextLine line = getLines()[lineIdx]; | ||
| TextLine[] lines = getLines(); | ||
| TextLine line = lines[lineIdx]; |
There was a problem hiding this comment.
Did you break this up so that it's easier to read? Or is this "noise" (as some might call it) unintentional?
There was a problem hiding this comment.
No. The lines variable is used in a if statement to check whether this is a wrapped paragraph 😉
There was a problem hiding this comment.
Ah... I see now. Sorry, I misread it.
|
I'll submit a PR to your repo with a test that can tell us for sure. |
|
@JFormDesigner In your PR, could you add Edit: Sorry, I said before I'd submit a PR to yours. I've pulled a local branch of yours with my test and it works. Please merge my PR to yours and then I'll merge yours here. |
|
Also, thank you for figuring out a way to resolve this. I'd tried a number of times and never got anything to work since I didn't understand the internal API for TextLayout. |
This PR fixes some issues with caret positioning in wrapped lines:
DOWNkey at end of line now moves caret to end of next line (and not beginning of line after next line).E.g. if caret is at
|thenDOWNkey moves it to^(and not*as before).UPkey now always works as expected (and no longer "locks" at*as before)when clicking with the mouse after text in a wrapped line (e.g. right to
^), then the caret is now positioned at the end of the hit line (and not at the beginning of the next line as before)Here is some code to reproduce:
I think this fixes #423