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

Sergey Bylokhov serb at openjdk.java.net
Mon Feb 14 23:29:10 UTC 2022


On Mon, 14 Feb 2022 16:45:09 GMT, Alisen Chung <achung at openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/border/TitledBorder.java line 354:
>> 
>>> 352:                         Graphics2D g2d = (Graphics2D) g2;
>>> 353:                         Path2D path = new Path2D.Float();
>>> 354:                         path.append(new Rectangle2D.Float((float) borderX, borderY, borderW, labelY - borderY), false);
>> 
>> Why the current coordinates do not work, is it because we calculate them in the wrong way or probably the insets are wrong?
>
> I think there's a rounding error when doing x.5 scalings causing the drawing area to be one pixel too small on the left side

Can you please check how it will work for the undecorated frame, if it will be fine then the problem is somehow related to the size of the insets.

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

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



More information about the client-libs-dev mailing list