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

Alexey Ivanov aivanov at openjdk.java.net
Fri May 6 11:56:47 UTC 2022


On Thu, 5 May 2022 18:00:16 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:
> 
>   saved translation values in EtchedBorder, updated test

src/java.desktop/share/classes/javax/swing/border/EtchedBorder.java line 137:

> 135: 
> 136:         g.drawLine((3*stkWidth/2)-1, h-(stkWidth-stkWidth/2),
> 137:                 w-(stkWidth-stkWidth/2), h-(stkWidth-stkWidth/2)); // bottom line

Suggestion:

        g.drawLine(stkWidth/2, h-(stkWidth-stkWidth/2),
                w-(stkWidth-stkWidth/2), h-(stkWidth-stkWidth/2)); // bottom line

If you change the initial `x` to be `stkWidth/2`, it always aligns with the rectangle drawn in `paintBorderRect`. Thus the issue where the bottom highlight line is short of a few pixels gets resolved.

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

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



More information about the client-libs-dev mailing list