Comment #5 on issue 174 by Printing nested Nodes with PPath as border as PDF will result in different offsets

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

        // draw the path -- stroke size doesn't seem to matter, use 1
g2.setStroke(new BasicStroke(1f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER));

        // draw the rectangle

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:  2.6 KB

Piccolo2D Developers Group:

Reply via email to