On Thu, 15 Jun 2023 19:38:00 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
> Modified the resize algorithm to work well with fractional scale, thanks for > deeper understanding of the problem thanks to @hjohn and @mstr2 . > > It is important to note that even though the constraints are given by the > user in unsnapped coordinates, they are converted to snapped values, since > the snapped values correspond to the actual pixels on the display. This > means the tests that validate honoring constraints should, in all the cases > where (scale != 1.0), assume possibly error not exceeding (1.0 / scale) (I > think). Tested the fix in Windows 11 and MacOS 13.3.1. The changes fixes the issue in Windows and in mac, the behavior is as expected with and without the change. Provided couple of minor comments inline. modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/ResizeHelper.java line 176: > 174: while (delta < -halfPixel) { > 175: double d = -pixel; > 176: if(smallShrink(d, desired)) { Minor: Add space after `if` -> `if (` modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/ResizeHelper.java line 184: > 182: while (delta > halfPixel) { > 183: double d = pixel; > 184: if(smallGrow(d, desired)) { Add space after `if` -> `if (` ------------- Changes requested by kpk (Committer). PR Review: https://git.openjdk.org/jfx/pull/1156#pullrequestreview-1495003754 PR Review Comment: https://git.openjdk.org/jfx/pull/1156#discussion_r1239728406 PR Review Comment: https://git.openjdk.org/jfx/pull/1156#discussion_r1239728609