From 9e39cf49ed3928700265cfad8cd82f35c7d56bb0 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Fri, 25 Apr 2008 10:37:07 -0700 Subject: [PATCH] 6687298: Reg testcase java/awt/Graphics2D/DrawString/RotTransText.java fails on windows Reviewed-by: igor, tdv --- .../Graphics2D/DrawString/RotTransText.java | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/jdk/test/java/awt/Graphics2D/DrawString/RotTransText.java b/jdk/test/java/awt/Graphics2D/DrawString/RotTransText.java index e130b1c4ae4..9f38fa113f2 100644 --- a/jdk/test/java/awt/Graphics2D/DrawString/RotTransText.java +++ b/jdk/test/java/awt/Graphics2D/DrawString/RotTransText.java @@ -23,7 +23,7 @@ /** * @test - * @bug 6683472 + * @bug 6683472 6687298 * @summary Transformed fonts using drawString and TextLayout should be in * the same position. */ @@ -44,14 +44,15 @@ public class RotTransText { Graphics2D g2d = bi.createGraphics(); - g2d.setColor(Color.white); - g2d.fillRect(0, 0, wid, hgt); - int x=130, y=130; String s = "Text"; int xt=90, yt=50; for (int angle=0;angle<360;angle+=30) { + + g2d.setColor(Color.white); + g2d.fillRect(0, 0, wid, hgt); + AffineTransform aff = AffineTransform.getTranslateInstance(50,90); aff.rotate(angle * Math.PI/180.0); @@ -69,20 +70,27 @@ public class RotTransText { fnt = fnt.deriveFont(attrMap); TextLayout tl = new TextLayout(s, fnt, frc); tl.draw(g2d, (float)x, (float)y); - } - // Test BI: should be no blue: only red and white. - int red = Color.red.getRGB(); - int blue = Color.blue.getRGB(); - int white = Color.white.getRGB(); - for (int px=0;px