Hi

It will return true eventually (remove the println from the loop to prove
that to yourself). The problem is that you're asking for a 'flattened' path
that only returns straight-line segments to approximate the curve. Since
you've given a second getPathIterator() argument of 1.0, the line segments
are very short (because you said the maximum distance between the line
segment and the ideal curve should be no greater than 1.0 pixels), and you
get a lot of them. Set the second argument to 25.0 and it will terminate
much quicker, albeit not looking much like a circle...

Cheers,
Pete

--
Pete Cockerell
California, USA

----- Original Message -----
From: Rosa M� Mac�as Verde <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 11, 1999 5:54 AM
Subject: [java2d] PathIterator.isDone()


>
> Hello everybody,
>
>  I've done a little program just to see how PathIterator works. The
> problem I have is that isDone() doesn't seem to ever return true.
> The code looks like this:
>
>      Ellipse2D.Double ellipse = new Ellipse2D.Double();
>      ellipse.setFrame (50,50,300,300);
>     Area area = new Area(ellipse);
>
>     double[] coords = new double[6];
>     PathIterator pathIterator =  area.getPathIterator(null,1.0);
>
>     while (! pathIterator.isDone()){
>      System.out.println("segment type: " + type  );
>       pathIterator.next();
>  }
>
> ... itdoen't work. It falls into an infinite loop.
> Can anyone tell me the reason for this?
>
> Thanks
>
> Ros
>
>
> =====================================================================
> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> Java 2D Home Page: http://java.sun.com/products/java-media/2D/
>

=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/

Reply via email to