I've found a small but annoying bug. Occasionally, when trying to apply a Transform to a Line object, I get a NullPointerException because the points array is null for some reason. There is an easy way to fix this; simply change the following method:
Code:
public Shape transform(Transform transform) {
float[] temp = new float[4];
transform.transform(points, 0, temp, 0, 2);
return new Line(temp[0],temp[1],temp[2],temp[3]);
}
...to this:
Code:
public Shape transform(Transform transform) {
float[] temp = new float[4];
createPoints(); // <-- Inserted line
transform.transform(points, 0, temp, 0, 2);
return new Line(temp[0],temp[1],temp[2],temp[3]);
}