On Thu, 27 Aug 2026 08:10:40 GMT, John Hendrikx <[email protected]> wrote:

>> modules/javafx.graphics/src/main/java/javafx/scene/layout/BorderPane.java 
>> line 538:
>> 
>>> 536:             topHeight = result.y;
>>> 537:             t.resize(result.x, topHeight);
>>> 538:             topHeight = snapSpaceY(snapSpaceY(topMargin.getBottom()) + 
>>> topHeight + snapSpaceY(topMargin.getTop()));
>> 
>> Shouldn't the entire result here simply be snapped using `snapSpace`, 
>> something like this:
>> 
>> Suggestion:
>> 
>>             topHeight = snapSpaceY(topMargin.getBottom() + topHeight + 
>> topMargin.getTop());
>> 
>> 
>> Since the result is snapped and the `topHeight` is as well
>
> No, this is in the guide.
> 
> |`top`|`bottom`| a + b | snap(a + b) | snap(a) + snap(b) |
> |---|---|---|---|---|
> |0.6|0.6|1.2|1.0|2.0|
> |0.1|0.1|0.2|0.0|0.0|
> |0.1|0.8|0.9|1.0|1.0|
> |0.3|0.3|0.6|1.0|0.0|

Ah you are right, I thought that `topMargin.getBottom()` is already snapped, 
but it is not!
Deleted my comments below that asked the same question.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2262#discussion_r3870079623

Reply via email to