RFR: 8305709: [testbug] Tree/TableViewResizeColumnToFitContentTest fails with fractional screen scale

Kevin Rushforth kcr at openjdk.org
Thu Sep 21 11:30:47 UTC 2023


On Wed, 20 Sep 2023 17:52:33 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> tests/system/src/test/java/test/util/Util.java line 490:
>> 
>>> 488:                     double scale = win.getRenderScaleX();
>>> 489:                     // distance between pixels in the local (unscaled) coordinates is (1 / scale)
>>> 490:                     return 1.0 / scale;
>> 
>> Is this computation what you want? This will give a smaller tolerance for a screen scale of, say, 2.0 (0.5) than it will for 1.0 (1). Intuitively, this seems backwards. For a screen scale of 1, a tolerance of 1 might be too large, whereas for a screen scale of 3, a tolerance of 0.3333 might be too small. If the goal is to account for the results of snapping, then would a fixed tolerance of 0.5 be better? It's possible I'm missing something.
>
> this tolerance is to account for snapping, but it should be one half of the display pixel instead of the whole pixel (i.e. `0.5 / scale`).
> With 0.5, these tests fail because we need JDK-8299753 to go first (and pass with the fix).
> 
> What we can do is to merge this change and change the tolerance as a part of JDK-8299753.

My earlier comment about it being backwards was wrong. Since you are measuring and comparing user space pixels, those are indeed smaller for larger scale values. Ultimately, `0.5 / scale` would be a reasonable tolerance value.

> What we can do is to merge this change and change the tolerance as a part of JDK-8299753.

Sounds good to me.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1234#discussion_r1332906964


More information about the openjfx-dev mailing list