Skip to content

Commit c7b60b8

Browse files
committed
Merge pull request processing#2649 from JakubValtar/shape-fix
Corrected a typo in Tessellator#addQuadraticVertex()
2 parents 8bd1d42 + c14c350 commit c7b60b8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

core/src/processing/core/PGraphics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ protected void bezierVertexCheck(int shape, int vertexCount) {
18671867
"must be used before bezierVertex() or quadraticVertex()");
18681868
}
18691869
if (vertexCount == 0) {
1870-
throw new RuntimeException("vertex() must be used at least once" +
1870+
throw new RuntimeException("vertex() must be used at least once " +
18711871
"before bezierVertex() or quadraticVertex()");
18721872
}
18731873
}

core/src/processing/opengl/PGraphicsOpenGL.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3056,6 +3056,7 @@ public void bezierVertex(float x2, float y2, float z2,
30563056
protected void bezierVertexImpl(float x2, float y2, float z2,
30573057
float x3, float y3, float z3,
30583058
float x4, float y4, float z4) {
3059+
bezierVertexCheck(shape, inGeo.vertexCount);
30593060
inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
30603061
ambientColor, specularColor, emissiveColor, shininess);
30613062
inGeo.setNormal(normalX, normalY, normalZ);
@@ -3083,6 +3084,7 @@ public void quadraticVertex(float cx, float cy, float cz,
30833084

30843085
protected void quadraticVertexImpl(float cx, float cy, float cz,
30853086
float x3, float y3, float z3) {
3087+
bezierVertexCheck(shape, inGeo.vertexCount);
30863088
inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
30873089
ambientColor, specularColor, emissiveColor, shininess);
30883090
inGeo.setNormal(normalX, normalY, normalZ);
@@ -3109,6 +3111,7 @@ public void curveVertex(float x, float y, float z) {
31093111

31103112

31113113
protected void curveVertexImpl(float x, float y, float z) {
3114+
curveVertexCheck(shape);
31123115
inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
31133116
ambientColor, specularColor, emissiveColor, shininess);
31143117
inGeo.setNormal(normalX, normalY, normalZ);
@@ -11582,7 +11585,7 @@ void addBezierVertex(int i) {
1158211585
void addQuadraticVertex(int i) {
1158311586
pg.curveVertexCount = 0;
1158411587
pg.bezierInitCheck();
11585-
pg.bezierVertexCheck(pg.shape, i);
11588+
pg.bezierVertexCheck(POLYGON, i);
1158611589

1158711590
PMatrix3D draw = pg.bezierDrawMatrix;
1158811591

0 commit comments

Comments
 (0)