On Sun, 16 Aug 2026 18:07:07 GMT, Nir Lisker <[email protected]> wrote:

>> modules/javafx.graphics/src/main/java/javafx/scene/layout/package-info.java 
>> line 409:
>> 
>>> 407:  *         The same rule applies to distinct margins and gaps: snap 
>>> each one with {@code snapSpaceX/Y}, then re-snap
>>> 408:  *         the final sum with {@code snapSpaceX/Y} again. For more 
>>> information, refer to <em>Re-snap after
>>> 409:  *         calculations, using the meaning of the result</em>.
>> 
>> This referred-to section hasn't appeared yet.
>> Suggestion:
>> 
>>  *         the final sum with {@code snapSpaceX/Y} again. For more 
>> information, refer to <em>Re-snap after
>>  *         calculations, using the meaning of the result</em> below.
>
> Additionally, I think this "for more information" part appears too late. I'd 
> think it belongs in the section above about classification since it looks 
> like a direct contradiction to what it wrote (sizes are snapped with `space` 
> suddenly).
> 
> The rules about snapping a sum of snapped numbers it split between sections. 
> For sizes, it is explained both here and in *Re-snapping* (use `snapSpace`), 
> gaps/spaces are explained here (use `snapSpace`), and coordinates are 
> explained in *Re-snapping* (use `snapPosition`):
> 
>  * The final {@code snapSpaceX} does not mean that the allocated width is 
> empty space, it merely uses
>  * the snapping method to remove a tiny amount of floating-point drift.
>  * <p>
>  * The same principle applies to coordinates: after calculating a final 
> coordinate from snapped values, use
>  * {@code snapPositionX/Y} to remove potential floating-point drift.
> 
> I'd put all 3 of them in one place before they are used and avoid the 
> repetition.
> 
> I'll note that it was mentioned previously in *Choosing the snapping 
> operation* with
> 
> <li>{@code snapSpaceX/Y} can also be used to remove floating-point drift from 
> the result of a computation.
> 
> so the point about removing floating-point drift is now in 3 places.

I've reordered the bullet points, so that arithmetic drift is explained first. 
I've also reworded the other bullet points a bit.

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

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

Reply via email to