RFR: 8299753: Tree/TableView: Column Resizing With Fractional Scale

Karthik P K kpk at openjdk.org
Thu Jun 27 17:31:19 UTC 2024


On Thu, 15 Jun 2023 19:38:00 GMT, Andy Goryachev <angorya at 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 .
> 
> Removed earlier manual tester in favor of the monkey tester.
> 
> 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).

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.

Left a inline comment.
Otherwise looks good to me

Tested the changes in Windows 11 with different scale values. The fix works as expected.
I will review the code soon and complete the review.

modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/ResizeHelper.java line 112:

> 110:                 distribute(delta, pref);
> 111:             }
> 112:         } else if (delta > 0.0) {

Do we need delta = 0.0 condition here?

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
Marked as reviewed by kpk (Committer).

PR Review: https://git.openjdk.org/jfx/pull/1156#pullrequestreview-1506543354
PR Comment: https://git.openjdk.org/jfx/pull/1156#issuecomment-1848411826
PR Review Comment: https://git.openjdk.org/jfx/pull/1156#discussion_r1247456039
PR Review Comment: https://git.openjdk.org/jfx/pull/1156#discussion_r1239728406
PR Review Comment: https://git.openjdk.org/jfx/pull/1156#discussion_r1239728609


More information about the openjfx-dev mailing list