On Tue, 13 Oct 2026 21:17:52 GMT, Andy Goryachev <[email protected]> wrote:

>> Florian Kirmaier has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   JDK-8392169
>>   GridPane - added test for baseline
>
> modules/javafx.graphics/src/main/java/javafx/scene/layout/GridPane.java line 
> 2050:
> 
>> 2048:         boolean isPositive = wasPositive;
>> 2049: 
>> 2050:         CompositeSize limitSize = shrinking? computeMinHeights(widths) 
>> :
> 
> this might produce wrong results with baseline-aligned nodes (we might want 
> to add VPos.BASELINE case to the tests).
> 
> example: narrow pane with 
> - baseline-aligned TextFlow at row 0
> - Region min height=30, prefHeight=100 at row 1

Added a test which works with the PR.

And this is a test - which is also broken on master but shouldn't be fixed in 
this PR:


    @Test
    public void testShrinkingBaselineAlignedTextFlowDoesNotOverlap() {
        GridPane gridpane = new GridPane();
        TextFlow textFlow = new TextFlow(new Text("some long text that has to 
wrap in a narrow pane"));
        Region below = new Region();
        below.setMinHeight(30);
        below.setPrefHeight(100);
        GridPane.setValignment(textFlow, VPos.BASELINE);
        gridpane.add(textFlow, 0, 0);
        gridpane.add(below, 0, 1);

        gridpane.resize(60, 100);
        gridpane.layout();

        double textFlowBottom = textFlow.getLayoutY() + textFlow.getHeight();
        assertTrue(textFlowBottom <= below.getLayoutY(),
                "TextFlow (bottom " + textFlowBottom + ") overlaps the region 
below (y " + below.getLayoutY() + ")");
    }
    ```

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2313#discussion_r4283428997

Reply via email to