On Sat, 25 Oct 2025 09:26:33 GMT, John Hendrikx <[email protected]> wrote:
> This PR will snap the values returned by `ScrollPaneSkin`s compute methods, > and `Control`s `layoutChildren` method to prevent scroll bars from showing up > (when using the `AS_NEEDED` policy) due to subtle rounding errors. The > scroll pane internally will compare its own height (minus insets) with its > content height, and determine if vertical (or horizontal) scroll bar needs to > be shown. If the values being compared are even slightly off (by a few ulp's > in floating point terms) then it may conclude a scroll bar should be shown > when it should not be. > > See the sample program and video in the related JBS ticket. > > Note: in many places we forget to resnap values after seemingly innocent > floating point calculations (even when all values involved are snapped > already, errors can be introduced). It is out of scope for this PR to fix > all of these. > > Note 2: since we only want to fix a rounding error, `snapSpace` is used and > not `snapSize` as the latter will ceil values which would make tiny errors > worse if they are just one ulp above the desired value. @hjohn is absolutely right here. The fix is simple enough, perhaps 1 reviewer is enough (I'll take a look). @kevinrushforth do you think we'd need a unit test for this PR? ------------- PR Comment: https://git.openjdk.org/jfx/pull/1948#issuecomment-3453061751
