diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index 8420f72f6..d0db5006b 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -2065,7 +2065,12 @@ public class PShape implements PConstants { vertices[index][X] = vec.x; vertices[index][Y] = vec.y; - vertices[index][Z] = vec.z; + + if (vertices[index].length > 2) { + vertices[index][Z] = vec.z; + } else if (vec.z != 0 && vec.z == vec.z) { + throw new IllegalArgumentException("Cannot set a z-coordinate on a 2D shape"); + } } diff --git a/core/todo.txt b/core/todo.txt index 3ee3c95b7..99af134bb 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -4,6 +4,8 @@ X https://github.com/processing/processing/issues/2228 X https://github.com/processing/processing/pull/2324 X move to native OS X full screen (gets rid of native code) X https://github.com/processing/processing/issues/2641 +X do bounds check on setVertex(PVector) +X https://github.com/processing/processing/issues/2556 data X add copy() method to Table