Skip to content

Commit 1b0083f

Browse files
committed
Fix PShape creation in P3D
Related to processing#3776
1 parent efc5f74 commit 1b0083f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/processing/core/PGraphics.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,15 +1784,15 @@ public PShape createShape(int kind, float... p) {
17841784
if (kind == POINT) {
17851785
if (is3D() && len != 2 && len != 3) {
17861786
throw new IllegalArgumentException("Use createShape(POINT, x, y) or createShape(POINT, x, y, z)");
1787-
} else if (len != 2) {
1787+
} else if (is2D() && len != 2) {
17881788
throw new IllegalArgumentException("Use createShape(POINT, x, y)");
17891789
}
17901790
return createShapePrimitive(kind, p);
17911791

17921792
} else if (kind == LINE) {
17931793
if (is3D() && len != 4 && len != 6) {
17941794
throw new IllegalArgumentException("Use createShape(LINE, x1, y1, x2, y2) or createShape(LINE, x1, y1, z1, x2, y2, z1)");
1795-
} else if (len != 4) {
1795+
} else if (is2D() && len != 4) {
17961796
throw new IllegalArgumentException("Use createShape(LINE, x1, y1, x2, y2)");
17971797
}
17981798
return createShapePrimitive(kind, p);

0 commit comments

Comments
 (0)