jpb-phet wrote:

> I believe I have found a bug in the XYArray class when I was using it
> to create a PLine.  Here is a simple main routine that duplicates the
> bug.  In the version of Piccolo that I'm using, this throws an
> exception, and I've looked at the trunk and believe that the bug is
> still there.
> public class PiccoloBugDemo {
>    public static void main( String[] args ) {
>        XYArray pointArray = new XYArray( 10 );
>        pointArray.setX( 0, 5 );
>        System.out.println("Point count is: " +
> pointArray.getPointCount());
>        System.out.println("X value of first point in array is: " +
> pointArray.getX( 0 ));
>    }
> }
> The exception is thrown on the line "pointArray.setX" because the
> number of points is incorrectly set when using this constructor.

Thanks for the note, might you be able to create an issue for this?

> I was able to work around this easily by using a PPath and creating a
> shape, which makes me wonder if it makes sense to maintain the PLIne
> class and the related classes (such as this XYArray class).  Perhaps
> they should be deprecated.

It might make sense to keep PLine around if it is more efficient than
PPath for lines.  I can't say that it is.


Piccolo2D Developers Group:

Reply via email to