File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1772,12 +1772,32 @@ protected void drawPrimitive(PGraphics g) {
17721772 protected void drawGeometry (PGraphics g ) {
17731773 // get cache object using g.
17741774 g .beginShape (kind );
1775+
1776+ boolean insideContour = false ;
1777+ int codeIndex = 0 ;
1778+
17751779 if (style ) {
17761780 for (int i = 0 ; i < vertexCount ; i ++) {
1781+ if (vertexCodes [codeIndex ++] == BREAK ) {
1782+ if (insideContour ) {
1783+ g .endContour ();
1784+ }
1785+ g .beginContour ();
1786+ insideContour = true ;
1787+ }
1788+
17771789 g .vertex (vertices [i ]);
17781790 }
17791791 } else {
17801792 for (int i = 0 ; i < vertexCount ; i ++) {
1793+ if (vertexCodes [codeIndex ++] == BREAK ) {
1794+ if (insideContour ) {
1795+ g .endContour ();
1796+ }
1797+ g .beginContour ();
1798+ insideContour = true ;
1799+ }
1800+
17811801 float [] vert = vertices [i ];
17821802 if (vert .length < 3 || vert [Z ] == 0 ) {
17831803 g .vertex (vert [X ], vert [Y ]);
@@ -1786,6 +1806,10 @@ protected void drawGeometry(PGraphics g) {
17861806 }
17871807 }
17881808 }
1809+
1810+ if (insideContour ) {
1811+ g .endContour ();
1812+ }
17891813 g .endShape (close ? CLOSE : OPEN );
17901814 }
17911815
You can’t perform that action at this time.
0 commit comments