Implemented curveVertex() in PShape

This commit is contained in:
codeanticode
2021-12-11 16:11:50 -05:00
parent a62fe39ede
commit a498e26100
+23 -1
View File
@@ -1363,17 +1363,39 @@ public class PShape implements PConstants {
public void curveDetail(int detail) {
}
public void curveTightness(float tightness) {
}
public void curveVertex(float x, float y) {
if (vertices == null) {
vertices = new float[10][];
} else if (vertexCount >= vertices.length) {
vertices = (float[][]) PApplet.expand(vertices);
}
vertices[vertexCount++] = new float[] { x, y };
if (vertexCodes == null) {
vertexCodes = new int[10];
} else if (vertexCodes.length == vertexCodeCount) {
vertexCodes = PApplet.expand(vertexCodes);
}
vertexCodes[vertexCodeCount++] = CURVE_VERTEX;
if (x > width) {
width = x;
}
if (y > height) {
height = y;
}
}
public void curveVertex(float x, float y, float z) {
}
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .