lttng / lttng-scope

A trace viewer and analyzer for LTTng kernel and user space traces
https://lttng.org/beta/#lttng-scope
Eclipse Public License 1.0
28 stars 6 forks source link

timegraph: Weird selection behaviour when very zoomed-in #25

Closed ghost closed 7 years ago

ghost commented 7 years ago

When zooming in very close into the view, the selection rectangle starts behaving strangely: the border strokes are thinner than they should be, sometimes there are artifacts lingering around when clicking in many places, and the selection itself starts being unreliable.

It's unclear what the exact threshold is for this behaviour to happen (fNanosPerPixels < 1.0 maybe?) but it's only when the view is zoomed in a lot. Upon zooming out to wider range it starts behaving normally again.

ghost commented 7 years ago

Some updates, looks like this is "simply" a bug/limitation of the JavaFX library. When the scenegraph looks like this:

in a way that the Nodes need very large x/y/height/width coordinates, they start exhibiting rendering glitches. The selection rectangle is just the most obvious.

Prototyping a bit, I found out that using instead an intermediate Pane like this:

then positioning the Nodes using more "reasonable" coordinates values, and then relocate()'ing the smaller Pane inside the big one completely avoids the rendering problems. I have tested with values of width up to 1e16.

Note that we cannot go much higher than 1e16, because of the 53 significand bits in double precision. At 1ns/pixel, this gives us a visual range of about 115 days. Or ~11 days at 10 pixels-per-ns. Hopefully this limitation does not become a problem anytime soon!

ghost commented 7 years ago

Using the layoutX/Y property of nodes has the same effect after all (using relocate() sets those properties on the intermediate pane).