fix AIOOBE with curves in P3D and OPENGL (Bug #1153)

This commit is contained in:
benfry
2009-02-20 22:47:13 +00:00
parent 42f8cc6d87
commit 3302456098
2 changed files with 7 additions and 2 deletions

View File

@@ -1527,8 +1527,11 @@ public class PGraphics3D extends PGraphics {
protected void addPolygonTriangles() {
if (vertexOrder.length != vertices.length) {
int[] temp = new int[vertices.length];
// since vertex_start may not be zero, might need to keep old stuff around
PApplet.arrayCopy(vertexOrder, temp, vertexCount);
// vertex_start may not be zero, might need to keep old stuff around
// also, copy vertexOrder.length, not vertexCount because vertexCount
// may be larger than vertexOrder.length (since this is a post-processing
// step that happens after the vertex arrays are built).
PApplet.arrayCopy(vertexOrder, temp, vertexOrder.length);
vertexOrder = temp;
}

View File

@@ -14,6 +14,8 @@ X Pressing <Esc> in "Are you sure you want to Quit?" dialog quits Processing
X http://dev.processing.org/bugs/show_bug.cgi?id=1134
X Fix QUADS and QUAD_STRIP with P2D
X http://dev.processing.org/bugs/show_bug.cgi?id=1162
X ArrayIndexOutOfBoundsException when drawing curves in P3D and OPENGL
X http://dev.processing.org/bugs/show_bug.cgi?id=1153
invalid
X Sketchbook sub-menu is empty after changing Sketchbook location preference