On Thu, 20 Aug 2026 22:10:18 GMT, Andy Goryachev <[email protected]> wrote:
>> Michael Strauß has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> clamp child width/height
>
> modules/javafx.graphics/src/main/java/javafx/scene/layout/AnchorPane.java
> line 366:
>
>> 364:
>> 365: if (leftAnchor != null && rightAnchor != null) {
>> 366: return snapSpaceX(areaWidth - snappedLeftInset() -
>> snappedRightInset() - leftAnchor - rightAnchor);
>
> here and L379, L429, 435: is it possible for the result to become negative
> and/or clash with -1 sentient value?
> should we clamp it to 0?
Yes for L366 and L379. Opposing anchors plus insets can make the allocated
width or height negative, including exactly -1. For a content-biased child, a
negative value can be passed to `resize`, so those two snapped sizes should be
clamped to zero.
L429 and L435 are different: those are coordinates. Negative positions are
valid and required to preserve a right or bottom anchor when the child
overflows the pane, so those should not be clamped.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2264#discussion_r3827999201