RFR: 8279614: The left line of the TitledBorder is not painted on 150 scale factor [v3]

Alexey Ivanov aivanov at openjdk.java.net
Mon Mar 14 23:30:40 UTC 2022


On Mon, 14 Mar 2022 16:15:47 GMT, Alisen Chung <achung at openjdk.org> wrote:

>> Changed the drawing area to be increased by 0.5 on the left side to prevent clipping
>
> Alisen Chung has updated the pull request incrementally with one additional commit since the last revision:
> 
>   added functions for drawing border, fixed translate

I believe is the issue is broader. I modified the test to display four panels, each panel is moved pixel to the left. The screenshots below are taken with the current JDK code _without_ Alisen's fix.

**125%**
![Border painting @ 125%](https://user-images.githubusercontent.com/70774172/158275701-d08c3ecd-d7a3-4443-aaf1-2a6a6cc3778a.png)

**150%**
![Border painting @ 150%](https://user-images.githubusercontent.com/70774172/158276212-162e0b18-5ed9-4b38-b602-c7f07e2509c7.png)


When uiScale=1.25, you can see there's background color between the shadow and highlight on the second panel. The same problem is seen for the upper border. When uiScale=1.5, you can see that some lines are 2-pixel wide and some are 1-pixel wide.

I believe it's because of rounding. I don't know how we can make sure the lines are always drawn next to each other and always have the same thickness.

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

PR: https://git.openjdk.java.net/jdk/pull/7449



More information about the client-libs-dev mailing list