Skip to content
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

Custom Editor, Multiple Custom Objects, adding HyperlinkSegment and ImageSegment #70

Closed
gandalfas opened this issue Mar 21, 2019 · 0 comments · Fixed by #80
Closed

Custom Editor, Multiple Custom Objects, adding HyperlinkSegment and ImageSegment #70

gandalfas opened this issue Mar 21, 2019 · 0 comments · Fixed by #80

Comments

@gandalfas
Copy link

Expected Behavior

When I added hyperlinks and images to Jugen's StyledSegmentTextArea, I was hoping the hyperlinks would work.

Actual Behavior

The first and third hyperlinks in the demo behave correctly, but the second hyperlink in the demo is somehow corrupted:

  • mouse-hovering over it produces lots of calls to createNode (see stdout of the program)
  • hovering does not cause the hyperlink to become underlined
  • clicking the link does not execute its handler

This Issue began life elsewhere

I first reported this issue here: FXMisc/RichTextFX#807

In there, Jugen said:

So it turns out that the culprit for this behavior is the image, in particular the vertical size of the image.

When the image is very tall, specifically it seems when the image is taller than the view-port, AND the hyperlink is in the same paragraph as the image then the mouse over somehow causes a re-layout to occur which is what you are seeing.

If you replace the image with one that is smaller vertically or put the hyperlink in a different paragraph then the re-layout doesn't occur anymore and the hyperlink behaves as expected.

The origins of this misbehavior is I think inside VirtualFlow in Flowless ?

Reproducible Demo

The source files are here: https://github.com/Kim4444/RichTextFXIssue

Demo Notes: First I downloaded the files at https://github.com/Jugen/StyledSegmentTextArea. I tweaked the source slightly, then added HyperlinkSegment and ImageSegment. I also use ReadOnlyStyledDocumentBuilder so I could build the doc one paragraph at a time. I tried to make as few changes to Jugen's demo as I could. There are more details in the demo file CodeChanges.txt. I am uncertain if it is a bug in my code, or in RichTextFX/supporting classes. Thank you so much for any help!

Environment info:

RichTextFX Version: 0.9.3
Flowless 0.6.1
ReactFX 2.0-M5
UndoFX 2.1.0
WellBehavedFX 0.3.3
Operating System: Windows 10
Java version: 8u181

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 a pull request may close this issue.

1 participant