Fix setVertex for PATH PShapeOpenGL

This commit is contained in:
Jakub Valtar
2015-08-03 18:00:08 -04:00
parent b55a8ed5cb
commit 43acb69c49
2 changed files with 17 additions and 3 deletions

View File

@@ -1708,14 +1708,25 @@ public class PShapeOpenGL extends PShape {
return;
}
if (vertexCodes[index] != VERTEX) {
PGraphics.showWarning(NOT_A_SIMPLE_VERTEX, "setVertex()");
return;
}
// TODO: in certain cases (kind = TRIANGLE, etc) the correspondence between
// input and tessellated vertices is 1-1, so in those cases re-tessellation
// wouldn't be necessary. But in order to reasonable take care of that
// situation, we would need a complete rethinking of the rendering architecture
// in Processing :-)
inGeo.vertices[3 * index + 0] = x;
inGeo.vertices[3 * index + 1] = y;
inGeo.vertices[3 * index + 2] = z;
if (family == PATH) {
vertices[index][X] = x;
vertices[index][Y] = y;
if (is3D) vertices[index][Z] = z;
} else {
inGeo.vertices[3 * index + 0] = x;
inGeo.vertices[3 * index + 1] = y;
inGeo.vertices[3 * index + 2] = z;
}
markForTessellation();
}