On Mon, 17 Aug 2026 21:16:56 GMT, Michael Strauß <[email protected]> wrote:

>> Pixel snapping is really hard to get right (in fact, it's so hard that even 
>> JavaFX itself gets it wrong in so many places).
>> I've compiled a list of things that I've learned, because there isn't really 
>> any good documentation as of yet.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Michael Strauß has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   reframe section

I like the explanations very much (modulo minor comments).

One question - should we add backreferences to this new section from relevant 
methods in `Region` and `SkinBase`?

modules/javafx.graphics/src/main/java/javafx/scene/layout/package-info.java 
line 314:

> 312:  * <h3>Why snapped content can still look blurry</h3>
> 313:  *
> 314:  * Enabling pixel snapping on a region does not guarantee that the 
> region or its descendants will be rendered on

The way I see it (I could be wrong), ideally all layout operations should use 
snapped coordinates, that is, be performed using display pixels.  Assuming, of 
course, the entire parent chain is snapped.

The only downside of this method is more calls to snap* methods, but it seems 
to be the only method to guarantee correct sizing.

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

PR Review: https://git.openjdk.org/jfx/pull/2260#pullrequestreview-4954975741
PR Review Comment: https://git.openjdk.org/jfx/pull/2260#discussion_r3799154441

Reply via email to