From 902fbeaae8e4b400e7a33f9d8fcafd9f9b9badc8 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Wed, 10 Apr 2013 18:37:27 -0400 Subject: [PATCH] DISABLE_OPTIMIZED_STROKE hint only works in 3D --- core/src/processing/opengl/PGraphicsOpenGL.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 1d56284f5..30026f09b 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -1939,8 +1939,12 @@ public class PGraphicsOpenGL extends PGraphics { flush(); setFlushMode(FLUSH_WHEN_FULL); } else if (which == DISABLE_OPTIMIZED_STROKE) { - flush(); - setFlushMode(FLUSH_CONTINUOUSLY); + if (is2D()) { + PGraphics.showWarning("Optimized strokes can only be disabled in 3D"); + } else { + flush(); + setFlushMode(FLUSH_CONTINUOUSLY); + } } else if (which == DISABLE_STROKE_PERSPECTIVE) { if (0 < tessGeo.lineVertexCount && 0 < tessGeo.lineIndexCount) { // We flush the geometry using the previous line setting.