From 97dd0b0f1bf2e86494c890b6aa79f23544ca8e22 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Tue, 27 Nov 2012 02:40:02 +0000 Subject: [PATCH] Correct logic of begin/end contours in PShape. Fixes issue #1417 --- core/src/processing/opengl/PShapeOpenGL.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/processing/opengl/PShapeOpenGL.java b/core/src/processing/opengl/PShapeOpenGL.java index 172b2225c..e308eb3ab 100644 --- a/core/src/processing/opengl/PShapeOpenGL.java +++ b/core/src/processing/opengl/PShapeOpenGL.java @@ -350,6 +350,10 @@ public class PShapeOpenGL extends PShape { normalMode = NORMAL_MODE_AUTO; + // To make sure that the first vertex is marked as a break. + // Same behavior as in the immediate mode. + breakShape = true; + if (family == GROUP) { // GROUP shapes are always marked as ended. shapeEnded = true; @@ -895,6 +899,7 @@ public class PShapeOpenGL extends PShape { return; } openContour = true; + breakShape = true; } @@ -910,7 +915,6 @@ public class PShapeOpenGL extends PShape { return; } openContour = false; - breakShape = true; }