Fixed error reporting for bez/quad/curve vertices

When user calls bezierVertex()/quadraticVertex()/curveVertex() and does
not call beginShape()/beginShape(POLYGON) before or forgets to specify
first vertex(), proper error message is shown.
This commit is contained in:
Jakub Valtar
2014-07-26 02:00:26 +02:00
parent 9402ef4a0b
commit 406d38d51e
2 changed files with 4 additions and 1 deletions

View File

@@ -3056,6 +3056,7 @@ public class PGraphicsOpenGL extends PGraphics {
protected void bezierVertexImpl(float x2, float y2, float z2,
float x3, float y3, float z3,
float x4, float y4, float z4) {
bezierVertexCheck(shape, inGeo.vertexCount);
inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
ambientColor, specularColor, emissiveColor, shininess);
inGeo.setNormal(normalX, normalY, normalZ);
@@ -3083,6 +3084,7 @@ public class PGraphicsOpenGL extends PGraphics {
protected void quadraticVertexImpl(float cx, float cy, float cz,
float x3, float y3, float z3) {
bezierVertexCheck(shape, inGeo.vertexCount);
inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
ambientColor, specularColor, emissiveColor, shininess);
inGeo.setNormal(normalX, normalY, normalZ);
@@ -3109,6 +3111,7 @@ public class PGraphicsOpenGL extends PGraphics {
protected void curveVertexImpl(float x, float y, float z) {
curveVertexCheck(shape);
inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
ambientColor, specularColor, emissiveColor, shininess);
inGeo.setNormal(normalX, normalY, normalZ);