RFR: JDK-8294427 - Check boxes and radio buttons have rendering issues on Windows in High DPI env [v12]

Sergey Bylokhov serb at openjdk.org
Thu Jun 8 00:18:56 UTC 2023


On Fri, 26 May 2023 01:14:48 GMT, Rajat Mahajan <rmahajan at openjdk.org> wrote:

>> But still why the size on the components are so different? is it really caused by one "pixel/unit" we requested from the native?
>
> So, basically for w,h =19 we calculate a DPI of 140 and Dimension d = getPartSize(getTheme(widget, dpi), part, state); at line 172 of ThemeReader.java call returns a part size of 13 x 13 provided by windows as it is closer to DPI=120 (for 125% scaling).
> While for  w,h =20 we calculate a DPI of 147 and Dimension d = getPartSize(getTheme(widget, dpi), part, state); at line 172 of ThemeReader.java call returns a part size of 20 x 20 provided by windows as it is closer to DPI=144 (for 150% scaling).
> Thus part size calculated by us and provided by Windows matches and hence we see bigger properly rendered buttons while for the w,h=19 case we have 19x19 , while windows gives 13x13 
> and hence you see scaled down buttons with bad rendering.

Probably I missed something but I would like to clarify. As you mention above we ask Windows to return the image for the component for some specific size, the Windows may return image of exactly requested size if available or any other size. What we will do if the size is different? In the image above it seems we use it as is, but should we? probably we should rescale it?

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

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



More information about the client-libs-dev mailing list