RFR: JDK-8294427 - Check boxes and radio buttons have rendering issues on Windows in High DPI env [v2]
Rajat Mahajan
rmahajan at openjdk.org
Tue May 9 18:59:26 UTC 2023
On Mon, 8 May 2023 23:22:52 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> No, Region.clipRound does something little different than what I intend to do in
>> this code .
>> It works same as my code for 0.25 and 0.75 case. But not for 0.5 case.
>> For example in case of destwidth and destHeight = 19.5,
>> for my current code I see them rounded to 20, while with clipRound it is
>> rounded to 19.
>
> I guess it should do the same rounding the component do. If the size of the component is 19.5 and we round it to 20, then the image should use the same round logic. BTW why 19 is better than 20 here?
So, I added this code specifically to have improved rendering for the 25% cases, like 125%, 225%, 325% as rendering was a little off for these scale values and empirically based on what we saw it looked better with this calculation.
It is also important to note that windows is not consistent in what size it provides for a part(button) . For example for 150% it provides part size as 20 and we calculate it as 20 in above code. For 175% windows still provides 20 again (while we would expect higher value) and we calculate it as 23 and it works out good. But as I said earlier for 125% or 225% it works best with above code.
The 20 vs 19 thing that I mentioned above was to just show that clipRound doesn't calculate it same was as my code and can have rendering repercussions as it is very sensitive to pixel variation , even 1 pixel variation causes rendering artifacts.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13701#discussion_r1189019091
More information about the client-libs-dev
mailing list