From 261e60b5dff0564d78d294d4fae76fceb928b96b Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Wed, 29 Oct 2014 13:38:16 +0100 Subject: [PATCH] Fixed drawing 2D points to PShape (#2912) --- core/src/processing/opengl/PGraphicsOpenGL.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 72d7dff47..34da1f100 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -10064,6 +10064,7 @@ public class PGraphicsOpenGL extends PGraphics { IndexCache cache = tess.polyIndexCache; int index = in.renderMode == RETAINED ? cache.addNew() : cache.getLast(); firstPointIndexCache = index; + if (firstPolyIndexCache == -1) firstPolyIndexCache = index; // If the geometry has no fill, needs the first poly index. for (int i = 0; i < in.vertexCount; i++) { int count = cache.vertexCount[index]; if (PGL.MAX_VERTEX_INDEX1 <= count + nPtVert) { @@ -10192,6 +10193,7 @@ public class PGraphicsOpenGL extends PGraphics { IndexCache cache = tess.polyIndexCache; int index = in.renderMode == RETAINED ? cache.addNew() : cache.getLast(); firstPointIndexCache = index; + if (firstPolyIndexCache == -1) firstPolyIndexCache = index; // If the geometry has no fill, needs the first poly index. for (int i = 0; i < in.vertexCount; i++) { int nvert = 5; int count = cache.vertexCount[index];