mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Merge pull request #3781 from JakubValtar/bugfix-pshape-p3d
Fix PShape creation in P3D
This commit is contained in:
@@ -1784,7 +1784,7 @@ public class PGraphics extends PImage implements PConstants {
|
||||
if (kind == POINT) {
|
||||
if (is3D() && len != 2 && len != 3) {
|
||||
throw new IllegalArgumentException("Use createShape(POINT, x, y) or createShape(POINT, x, y, z)");
|
||||
} else if (len != 2) {
|
||||
} else if (is2D() && len != 2) {
|
||||
throw new IllegalArgumentException("Use createShape(POINT, x, y)");
|
||||
}
|
||||
return createShapePrimitive(kind, p);
|
||||
@@ -1792,7 +1792,7 @@ public class PGraphics extends PImage implements PConstants {
|
||||
} else if (kind == LINE) {
|
||||
if (is3D() && len != 4 && len != 6) {
|
||||
throw new IllegalArgumentException("Use createShape(LINE, x1, y1, x2, y2) or createShape(LINE, x1, y1, z1, x2, y2, z1)");
|
||||
} else if (len != 4) {
|
||||
} else if (is2D() && len != 4) {
|
||||
throw new IllegalArgumentException("Use createShape(LINE, x1, y1, x2, y2)");
|
||||
}
|
||||
return createShapePrimitive(kind, p);
|
||||
|
||||
Reference in New Issue
Block a user