RFR: 8313709: Wrong layout of a FlowPane in a BorderPane in a ScrollPane, if padding is too big

Kevin Rushforth kcr at openjdk.org
Tue Aug 8 12:33:40 UTC 2023


On Mon, 7 Aug 2023 10:53:06 GMT, Jose Pereda <jpereda at openjdk.org> wrote:

> So far, BorderPane does the calculation for the children min/pref width/height taken into account only the margin applied to them, if any, but not the total padding that could be applied as well to the BorderPane itself.
> 
> However, this padding needs to be taken into account as well, and this PR modifies BorderPane to subtract its insets from its size while doing the children min/pref width/height calculations.
> 
> A parameterized test has been included. 
> 
> It is a simplified version of the test case attached to https://bugs.openjdk.org/browse/JDK-8313709, but still shows how without this patch, two of the cases (padding with or without margin) fail, while pass with it.

@arapte Can you review this?

I left one comment on the test about not mixing JUnit4 and JUnit5.

modules/javafx.graphics/src/test/java/test/javafx/scene/layout/BorderPaneTest.java line 40:

> 38: import org.junit.Test;
> 39: import org.junit.jupiter.params.ParameterizedTest;
> 40: import org.junit.jupiter.params.provider.CsvSource;

We don't want to mix JUnit4 and JUnit5 API calls in the same test class file.

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

PR Review: https://git.openjdk.org/jfx/pull/1203#pullrequestreview-1567178577
PR Review Comment: https://git.openjdk.org/jfx/pull/1203#discussion_r1287042901


More information about the openjfx-dev mailing list