On Thu, 4 May 2023 19:35:32 GMT, Rajat Mahajan <rmaha...@openjdk.org> wrote:
>> src/java.desktop/share/classes/sun/swing/CachedPainter.java line 318: >> >>> 316: public Image getResolutionVariant(double destWidth, double >>> destHeight) { >>> 317: int w = (int) Math.floor(destWidth + 0.5); >>> 318: int h = (int) Math.floor(destHeight + 0.5); >> >> Isn't it what `Region.clipRound` does? > > 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? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13701#discussion_r1187981265