Skip to content

Make CaretNode transparent to mouse picking (fixes #124)#1032

Merged
Jugen merged 1 commit intoFXMisc:masterfrom
chrisf-london:issue-124-make-caret-transparent-to-mouse-picking
Jul 20, 2021
Merged

Make CaretNode transparent to mouse picking (fixes #124)#1032
Jugen merged 1 commit intoFXMisc:masterfrom
chrisf-london:issue-124-make-caret-transparent-to-mouse-picking

Conversation

@chrisf-london
Copy link
Copy Markdown
Contributor

@chrisf-london chrisf-london commented Jul 20, 2021

When you install a mouse handler on a TextExt area using setOnMouseClicked() or similar, there's a small chance that your mouse click will be ignored. This happens approximately one time in ten in my experience. The problem occurs when you click at the exact same position as the flashing caret while the caret is visible; this confuses the java FX mouse-picking algorithm, which causes the event to be sent to the ParagraphText node rather than the TextExt. The fix is simply to make the caret transparent to mouse picking.

See this link for more evidence + screenshots : #124 (comment)

(should be a safe change, I can't think of any reason you'd want the caret to be pickable)

If you install a mouse handler on a TextExt area using setOnMouseClicked(), there's a small chance that your mouse click will be ignored (this happens approximately one time in ten in my experience).  The problem occurs when you click at the exact same position as the flashing caret while the caret is visible; this confuses the java FX mouse-picking algorithm, which causes the MouseEvent to be sent to the ParagraphText node rather than the TextExt. The fix is simply to make the caret transparent to mouse picking.

See this link for more evidence + screenshots : FXMisc#124
@Jugen
Copy link
Copy Markdown
Collaborator

Jugen commented Jul 20, 2021

@chrisf-london Excellent ! Thank you very much :-)

@Jugen Jugen merged commit 14eca9b into FXMisc:master Jul 20, 2021
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