Hi

I have a applet (see code) below which behaves a little strange.
It draws 2 circles with a basic stroke as its 'border'. The 1st circle is first 
filled then drawn; the 2nd circle the other way round. Notice how the border of 
the right circle seems to be thinner on the left side than on the right side ...
If you comment the g2.setRenderingHint-statement, the borders seems to be 
equally thick on both sides ??
I am running the applet under JDK 1.6.0.

Hope someone can provide some insight.

regards rob willemsen


********************** sample applet
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.geom.Ellipse2D;

public class FillStrokeAnomaly extends java.applet.Applet {

    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D)g;

        Ellipse2D.Double e1 = new Ellipse2D.Double(10,10,160,160);
        Ellipse2D.Double e2 = new Ellipse2D.Double(180,10,160,160);
        BasicStroke bs = new BasicStroke(7, BasicStroke.CAP_SQUARE, 
BasicStroke.JOIN_BEVEL, 0,
                                         new float[] { 10, 10 }, 3);

        
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);

        //first fill, then draw
        g2.setPaint(Color.ORANGE);
        g2.fill(e1);
        g2.setStroke(bs);
        g2.setPaint(Color.BLACK);
        g2.draw(e1);

        //first draw then fill
        // draw circle with stroke square, a join bevel, and uses a dash phase
        g2.setStroke(bs);
        g2.setPaint(Color.BLACK);
        g2.draw(e2);
        g2.setPaint(Color.ORANGE);
        g2.fill(e2);
    }
}
[Message sent by forum member 'rtwillemsen' (rtwillemsen)]

http://forums.java.net/jive/thread.jspa?messageID=204955

===========================================================================
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".

Reply via email to