On Mon, 15 May 2023 22:06:11 GMT, Rajat Mahajan <rmaha...@openjdk.org> wrote:

>> From the picture above it does not seem that the difference is just 1 pixel, 
>> no?
>
> Actually I literally didn't mean 1 physical pixel, it was more figurative to 
> say that when the width calculation on Java side is reduced by 1 we see a big 
> difference in final scaling.

Perhaps, this needs additional details. The size of checkbox and radio button 
is 13 as reported by Theme API for the standard DPI of 96. Being a prime 
number, 13 doesn't scale well, there's always fractional part unless the scale 
is whole. Thus, the scaled size never matches.

As the result, `CachedPainter` seems to apply a scale to compensate for that — 
whether we choose ceil or floot.

The entire thing should have been simpler: a `MultiResolutionImage` which 
paints the background according to the scale requested. Yet it proved to be not 
as simple. We're planning to look further into simplifying it if possible and, 
alternatively or in addition to, considering [dynamic layout based on graphics 
configuration](https://github.com/openjdk/jdk/pull/13701#discussion_r1187985627)
 as you suggested above.

The current solution may be not perfect but it provides better rendering 
compared to what we have now: *the controls look crisp only on the main 
display*.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13701#discussion_r1195604571

Reply via email to