From 27d002c9dea55256510894609401abd3ae1577b8 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Mon, 3 Mar 2014 14:04:29 -0500 Subject: [PATCH] fixes #2375 --- core/src/processing/opengl/PGraphicsOpenGL.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 5806cedcd..bf2cb2442 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -3696,12 +3696,15 @@ public class PGraphicsOpenGL extends PGraphics { float lastX = 0; float lastY = 0; + boolean open = false; beginShape(); while (!outline.isDone()) { int type = outline.currentSegment(textPoints); - if (type == PGL.SEG_MOVETO) { // 1 point (2 vars) in textPoints - } else if (type == PGL.SEG_LINETO) { // 1 point - if (type == PGL.SEG_MOVETO) beginContour(); + if (!open) { + beginContour(); + open = true; + } + if (type == PGL.SEG_MOVETO || type == PGL.SEG_LINETO) { // 1 point vertex(x + textPoints[0], y + textPoints[1]); lastX = textPoints[0]; lastY = textPoints[1]; @@ -3731,6 +3734,7 @@ public class PGraphicsOpenGL extends PGraphics { lastY = textPoints[5]; } else if (type == PGL.SEG_CLOSE) { endContour(); + open = false; } outline.next(); }