Comment #5 on issue 174 by [email protected]: Printing nested Nodes with
PPath as border as PDF will result in different offsets
http://code.google.com/p/piccolo2d/issues/detail?id=174
I can get this bad behavior on Mac OS + straight up Java2D without
Piccolo2D at play. Even if I use double-precision Path2D objects. (See
attached file--I'm roughly mimicking the Java2D calls that Piccolo2D issues
in the PiccoloPrintBug example above.)
On Windows, the red path draws at the same position as the blue fill. On
Mac OS, the path and fill diverge increasingly for smaller and smaller
scaling values:
final Rectangle2D rect = new Rectangle2D.Double(0, 0, 200, 200);
final AffineTransform xform = new AffineTransform(0.001, 0, 0,
0.001, 0, 0);
// use the same path to fill and stroke -- still, they diverge
Path2D.Double path = new Path2D.Double();
path.append(rect, false);
// transform for printing
g2.transform(xform);
// draw the path -- stroke size doesn't seem to matter, use 1
g2.setStroke(new BasicStroke(1f, BasicStroke.CAP_ROUND,
BasicStroke.JOIN_MITER));
g2.setColor(Color.red);
g2.draw(path);
// draw the rectangle
g2.setColor(Color.blue);
g2.fill(path);
I conclude that this is a Mac OS Java issue with drawing paths to a print
Graphics at small scale. I'm thinking there's much we can do about it, but
take a look at my example and comment.
Attachments:
Issue174Reduced.java 2.6 KB
--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en