I don't think this has do to with stroking, but with how shapes are stroked.
I've derived a slighly simpler test from yours that shows the same problem with
AA turned off and a Rectangle2D instead of an Ellipse2D. However, I am also
missing a reasonable explanation why this is so, except rounding or accuracy
problems in the stroking. Note how a g2.translate(0.5, 0.4) gets rid of the
problem.
Interestingly enough, I've created a similar testcase that does practically the
same on Cairo (outside of Java land) and shows similar results...
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.geom.Arc2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.Ellipse2D;
public class FillStrokeAnomaly extends java.applet.Applet {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
Rectangle2D.Double e1 = new Rectangle2D.Double(10,10,160,160);
Rectangle2D.Double e2 = new Rectangle2D.Double(180,10,160,160);
//first fill, then draw
g2.setPaint(Color.ORANGE);
g2.fill(e1);
g2.setPaint(Color.BLACK);
g2.draw(e1);
//first draw then fill
g2.setPaint(Color.BLACK);
g2.draw(e2);
g2.setPaint(Color.ORANGE);
g2.fill(e2);
}
public static void main(String[] args) {
Frame f = new Frame();
f.add(new FillStrokeAnomaly());
f.setSize(600, 400);
f.setVisible(true);
}
}
[Message sent by forum member 'roman_kennke' (roman_kennke)]
http://forums.java.net/jive/thread.jspa?messageID=206988
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".