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 17:13:37 UTC 2022
On Fri, 11 Feb 2022 23:44:22 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
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?
test/jdk/java/awt/TitledBorder/TitledBorderTest.java line 1:
> 1: import java.awt.BorderLayout;
To prevent all this jcheck issue you can install the jcheck hook locally.
test/jdk/java/awt/TitledBorder/TitledBorderTest.java line 51:
> 49: saveImage(buff, "test.png");
> 50: throw new RuntimeException("Border was clipped or overdrawn.");
> 51: }
Can we draw directly to the buffered image using the scaled graphics to reproduce the bug?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7449
More information about the client-libs-dev
mailing list