I think your diagnosis is right though: sometimes the layout is not triggered 
when a property is changed,
the recent bug like that is


JDK-8307117<https://bugs.openjdk.org/browse/JDK-8307117> TextArea: wrapText 
property ignored when changing font

I wonder if some kind of a generic unit test could be developed to identify 
such cases.

-andy


From: Nir Lisker <nlis...@gmail.com>
Date: Monday, May 1, 2023 at 13:09
To: Andy Goryachev <andy.goryac...@oracle.com>
Cc: openjfx-dev <openjfx-dev@openjdk.org>
Subject: [External] : Re: JDK-8199934: ScrollPaneSkin incorrectly lays out its 
scrollbars
If I knew what the fix was I would have. Right now I'm not sure anymore what 
the correct behavior should be even.

On Mon, May 1, 2023 at 10:44 PM Andy Goryachev 
<andy.goryac...@oracle.com<mailto:andy.goryac...@oracle.com>> wrote:
Nir, would you like to submit a pull request?

Thank you
-andy

From: openjfx-dev 
<openjfx-dev-r...@openjdk.org<mailto:openjfx-dev-r...@openjdk.org>> on behalf 
of Nir Lisker <nlis...@gmail.com<mailto:nlis...@gmail.com>>
Date: Sunday, April 30, 2023 at 10:04
To: openjfx-dev <openjfx-dev@openjdk.org<mailto:openjfx-dev@openjdk.org>>
Subject: JDK-8199934: ScrollPaneSkin incorrectly lays out its scrollbars
Hi,

I took a quick jab at this issue [1]. Using the reproducer in the ticket, 
launch and resize the stage vertically so that the buttons at the bottom are 
only partially visible.

The current behavior is as follows:
When the scrollbar is not needed, toggling to the AS_NEEDED policy reallocates 
the scrollbar space for the buttons (they move up).
When the scrollbar is needed, toggling to the AS_NEEDED policy still 
reallocates space, and the scrollbar takes away space from the content node. 
This is wrong.

I modified the method 'computeHsbSizeHint' to

private double computeHsbSizeHint(ScrollPane sp) {
    return determineHorizontalSBVisible() ? 
hsb.prefHeight(ScrollBar.USE_COMPUTED_SIZE) : 0;
}

Now the policy toggling behavior is correct both when the scrollbar is needed 
and when it's not - the space is reallocated not at the expense of the content. 
However, enlarging the stage horizontally while AS_NEEDED is selected does not 
reallocate the space (you need to toggle the policies). I'm guessing there's a 
missing call to layoutChildren during this resizing.

Does anyone have any input here?

Thanks,
Nir

[1] https://bugs.openjdk.org/browse/JDK-8199934

Reply via email to