Hi all, I've implemented a method which draws a polygon with transparent
holes in it. it seems to work fine until it hangs (randomly) on the
graphics .fill(Area) call. Here is the code.. as you can see, it apears to
be trivial, but it seems to hang sometimes, and other times it works fine.
any ideas? thanks!
//construct main polygon
this.bgGraphics.setPaint(Color.red);
java.awt.geom.Area area = new java.awt.geom.Area(new java.awt.Polygon(pointsX,
pointsY, nPoints[0]));
//nuke the other polygons
for (i=1; i<nPoly; i++)
{
for (j=0; j<nPoints[i]; j++)
{
pointsX[j] = x[j];
pointsY[j] = y[j];
}
//subtract the inner polygons
area.subtract(new java.awt.geom.Area(new java.awt.Polygon(pointsX,
pointsY, nPoints[i])));
}
System.out.println("Hangs sometimes on the next call");
//fill in the area using the current brush colour
this.bgGraphics.fill(area);
System.out.println("Sometimes never gets here");
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/