Caught a literal edge case: for some reason, after resizing an image, the doPhysics() function started locking up on a warning that points along the edge of the image were not held within triangles. Added a try-catch and continue statement to force the process through without failing on those particular points.
This commit is contained in:
parent
69110f615f
commit
1d3b6ac53e
|
@ -866,9 +866,11 @@ void doPhysics() {
|
|||
|
||||
for (int i = vorPointsAdded; i < temp; i++) {
|
||||
// Optional, for diagnostics:::
|
||||
// println("particles[i].x, particles[i].y " + particles[i].x + ", " + particles[i].y );
|
||||
|
||||
voronoi.addPoint(new Vec2D(particles[i].x, particles[i].y ));
|
||||
try {
|
||||
voronoi.addPoint(new Vec2D(particles[i].x, particles[i].y ));
|
||||
} catch (Exception e) {
|
||||
continue;
|
||||
}
|
||||
vorPointsAdded++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue