Skip to content

Commit 90b3e52

Browse files
committed
implemented LINE_STRIP and LINE_LOOP in the Android2D renderer
1 parent 09a1869 commit 90b3e52

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

core/src/processing/a2d/PGraphicsAndroid2D.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,14 @@ public void vertex(float x, float y) {
382382
}
383383
break;
384384

385+
case LINE_STRIP:
386+
case LINE_LOOP:
387+
if (vertexCount >= 2) {
388+
line(vertices[vertexCount-2][X],
389+
vertices[vertexCount-2][Y], x, y);
390+
}
391+
break;
392+
385393
case TRIANGLES:
386394
if ((vertexCount % 3) == 0) {
387395
triangle(vertices[vertexCount - 3][X],
@@ -507,6 +515,11 @@ public void endShape(int mode) {
507515
}
508516
drawPath();
509517
}
518+
} else if (shape == LINE_LOOP && vertexCount >= 2) {
519+
line(vertices[vertexCount-1][X],
520+
vertices[vertexCount-1][Y],
521+
vertices[0][X],
522+
vertices[0][Y]);
510523
}
511524
shape = 0;
512525
}

0 commit comments

Comments
 (0)