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

>> modules/javafx.graphics/src/main/java/javafx/scene/layout/BorderPane.java 
>> line 502:
>> 
>>> 500:             final double minWidth = minWidth(-1);
>>> 501:             final double minHeight = minHeight(-1);
>>> 502:             width = snapSpaceX(Math.max(width, minWidth));
>> 
>> Is it really needed to `snapSpace` the result of `minWidth` or `minHeight` ?
>
> I'd expect `snapSize` really, since the minimum width is the size of the 
> content.
> 
> Note that what border pane is doing here is very questionable; it should have 
> measured these things when its compute methods get called, and stored this 
> information, as during compute is the only time the `BorderPane` can adjust 
> its own min/pref/max size.

You mean stored as variable during the `computeXXX` methods? Might be worth 
fixing in your virtual layout PR?

Beside that, I was mostly wondering if we can trust the return value of 
`minWidth(-1)` or `minHeight(-1)` to be always snapped and therefore correct, 
so we never need to (re)snap it.

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

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

Reply via email to