RFR: 8264591: HBox/VBox child widths pixel-snap to wrong value [v7]

Andy Goryachev angorya at openjdk.org
Mon Apr 24 23:19:17 UTC 2023


On Mon, 24 Apr 2023 17:52:59 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

> I'm sorry, I don't quite see what you mean here, perhaps this is unique to the TableView layout.

It is not unique.  The scenario I am trying to describe is when set[VH]Grow is true, possibly for multiple nodes.  With the fractional scale and snapping, the snapped coordinates are not equidistant.  So if one node has to move, all of a sudden its width must change, affecting the others.  Which means

1. one cannot scale the constraints as they become position-dependent
2. no single pass algorithm is going to work

(the reason  I mentioned TableView is because I've tripped over the very same problem, see JDK-8299753)

For reference:

scale=1.25
x=1 snapped=0.800 step=0.800
x=2 snapped=2.400 step=1.600
x=3 snapped=3.200 step=0.800
x=4 snapped=4.000 step=0.800
x=5 snapped=4.800 step=0.800
x=6 snapped=6.400 step=1.600
x=7 snapped=7.200 step=0.800

scale=1.5
x=1 snapped=1.333 step=1.333
x=2 snapped=2.000 step=0.667
x=3 snapped=3.333 step=1.333
x=4 snapped=4.000 step=0.667
...

-------------

PR Comment: https://git.openjdk.org/jfx/pull/445#issuecomment-1520941769


More information about the openjfx-dev mailing list