From 3302456098778d886ff7edaecfd3100754165feb Mon Sep 17 00:00:00 2001 From: benfry Date: Fri, 20 Feb 2009 22:47:13 +0000 Subject: [PATCH] fix AIOOBE with curves in P3D and OPENGL (Bug #1153) --- core/src/processing/core/PGraphics3D.java | 7 +++++-- todo.txt | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/processing/core/PGraphics3D.java b/core/src/processing/core/PGraphics3D.java index 571a3f682..3f4c6acb0 100644 --- a/core/src/processing/core/PGraphics3D.java +++ b/core/src/processing/core/PGraphics3D.java @@ -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; } diff --git a/todo.txt b/todo.txt index 91e886557..5d22bb87b 100644 --- a/todo.txt +++ b/todo.txt @@ -14,6 +14,8 @@ X Pressing 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