Printing rotated shapes modifies stroke
Hi,
I'm writing some code that draws the same rectangle twice: the first time on the default graphic context and the second time on a rotated graphic context. The code works and I get the two shapes printed as I wanted with the correct stroke of 3 points. But when I try to print these objects, the first rectangle is printed with a 3 points stroke where the second rectangle is printed with a thin stroke (less than 1 ponint!)
Why is this happening? I'm using the same method to display and to print the shapes. The printing is done using the standard java.awt.print classes. I've already tried using the RenderingHints class but with no useful results. Any idea?
Thanks for your help
miki
This is the code:
Shape shape = new Rectangle(0, 0, 150, 30);
g2.translate(200, 200);
g2.setStroke(new BasicStroke(3.0f));
Rectangle rect = shape.getBounds();
g2.draw(shape);
AffineTransform at = new AffineTransform();
at.rotate(Math.toRadians(45.0));
AffineTransform atTrans = new AffineTransform();
atTrans.concatenate(at);
atTrans.translate(0, -(rect.height/2));
atTrans.translate(2.866, 0);
AffineTransform savedAT = g2.getTransform();
g2.transform(atTrans);
g2.setStroke(new BasicStroke(3.0f));
g2.draw(shape);
g2.setTransform(savedAT);

