RFR: JDK-8294427 - Check boxes and radio buttons have rendering issues on Windows in High DPI env [v2]
Alexey Ivanov
aivanov at openjdk.org
Tue May 16 19:29:46 UTC 2023
On Mon, 15 May 2023 22:06:11 GMT, Rajat Mahajan <rmahajan at 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
More information about the client-libs-dev
mailing list