Open swpalmer opened 3 years ago
Thanks for submitting and the demo program :-). Unfortunately I haven't been able to trace the problem :-(
I tested this with Java 1.8, 9, 11, and 15 as well as with RichTextFX 0.6.10, 0.9.0, and 0.10.5 with all of them showing the same wobble.
The demo program uses scrollXToPixel
but the wobble also occurs if you use setTranslateX
instead, so it's not the scroll code and therefore not the Flowless library that's responsible for scrolling.
I initially thought that it may be layout code being called twice but as far as I could debug and trace no layout code is being called multiple times.
I replaced the TextExt
nodes with normal Text
ones in RichTextFX and vice versa in the demo program with no difference, so it's also not TextExt
and I'm fairly sure also not TextFlowExt
. (Note that both each subclass Text and TextFlow respectively only adding functionality and not overriding any methods.)
Besides the above I noticed that the wobble only seems to happen on lines where there are multiple Text nodes, irrespective of any styling on those nodes. On lines with either no styling or styling that covers the entire line (so there's only one text node) the wobble doesn't occur.
I'm sorry to say that at this stage I'm at a loss and have no further ideas to pursue.
Expected Behavior
The entire line should scroll as a single unit. Like the top panel in the example case provided.
Actual Behavior
The rounding of positions of nodes within the CodeArea seems to cause adjacent nodes to occasionally be separated by an extra pixel. See the "wobble" of differently coloured nodes produced by the provided example.
Reproducible Demo
Run this program and notice the "wobbling" text in the lower panel:
Environment info:
Current Workarounds
Coding directly to use plain TextFlow and Text nodes avoids the issue, as seen in the top panel of the provided example.