On Sun, 16 Aug 2026 17:45:43 GMT, Nir Lisker <[email protected]> wrote:

>> Michael Strauß has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   review changes
>
> modules/javafx.graphics/src/main/java/javafx/scene/layout/package-info.java 
> line 442:
> 
>> 440:  *
>> 441:  *         // Incorrect: snapSizeX can turn floating-point noise into 
>> an extra pixel
>> 442:  *         double allocatedWidth = snapSizeX(firstWidth + gapWidth + 
>> secondWidth);
> 
> The correct example uses `snapSpaceX` (after snapping individually), but this 
> incorrect example uses `snapSizeX` without snapping individually. If the idea 
> is to demonstrate re-snapping, then the same method should be used, otherwise 
> it introduces another incorrectness.

I'm not sure what you mean here. The individual components are always snapped 
in this example, the mistake is using `snapSizeX` instead of `snapSpaceX`.

> modules/javafx.graphics/src/main/java/javafx/scene/layout/package-info.java 
> line 455:
> 
>> 453:  *         Since a region's position and allocated size are determined 
>> by its parent (and the {@code isSnapToPixel}
>> 454:  *         policy of its parent), it must not reposition or resize 
>> itself. If the allocated width or height is not
>> 455:  *         aligned, the region cannot both preserve the exact 
>> allocation and make its complete bounds pixel-aligned.
> 
> "...is not aligned" with what? pixel-aligned?

I've reworded this a bit.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2260#discussion_r3793222851
PR Review Comment: https://git.openjdk.org/jfx/pull/2260#discussion_r3793223776

Reply via email to