On Tue, 8 Nov 2022 18:31:33 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

>> Not 100% sure about this. It sounds somewhat logical. If we set the left 
>> anchor to be 5. Do we expect it to be 10 with a render scale of 2 -> 200% 
>> resolution?
>
> Not sure about render scale - it should be done elsewhere.
> 
> As for snapping, I think this code might be incorrect - it should honor 
> Region.snapToPixel setting.  All the intermediary computations need to use 
> unsnapped (original) values, then, at the last moment, call proper 
> Region.snap*() which either rounds or not, depending on the `snapToPixel`.
> 
> The only exception for this rule (of using snapped values in the intermediary 
> computations) is to ensure some kind of specific alignment, which I believe 
> is not the case here.

I'm not sure about this. Other places do the same, and there are lot of places 
actually which do something like `snappedLeftInsets` + `snappedRightInsets` or 
`final double w = snapSizeX(getWidth()) - x - snappedRightInset();` or similar. 
I think this was for a reason. 
And I have only oriented myself to the existing code in this case. If you are 
right, then this was done wrong everywhere.

Btw. I had a look and other container do snap their constraints, e.g. `H/VBox` 
its spacing, `GridPane` his `H/VGap`. So pretty sure we also should snap the 
anchor values.

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

PR: https://git.openjdk.org/jfx/pull/910

Reply via email to