From e61178f71ec00ef0f033ba0d65d0cbf84ed6a303 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Fri, 18 Sep 2015 18:09:37 -0500 Subject: [PATCH] can re-enable fill/stroke in PShapeOpenGL (fixes #3808) --- core/src/processing/opengl/PShapeOpenGL.java | 15 ++++----------- core/src/processing/opengl/PSurfaceJOGL.java | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/core/src/processing/opengl/PShapeOpenGL.java b/core/src/processing/opengl/PShapeOpenGL.java index d0c01faa3..2c9492ec2 100644 --- a/core/src/processing/opengl/PShapeOpenGL.java +++ b/core/src/processing/opengl/PShapeOpenGL.java @@ -1799,8 +1799,8 @@ public class PShapeOpenGL extends PShape { PShapeOpenGL child = (PShapeOpenGL) children[i]; child.setFill(fill); } - } else if (this.fill && !fill) { - setFillImpl(0x0); + } else if (this.fill != fill) { + markForTessellation(); } this.fill = fill; } @@ -1981,16 +1981,9 @@ public class PShapeOpenGL extends PShape { child.setStroke(stroke); } } else if (this.stroke != stroke) { - if (this.stroke) { - // Disabling stroke on a shape previously with - // stroke needs a re-tessellation in order to remove - // the additional geometry of lines and/or points. - markForTessellation(); - stroke = false; - } - setStrokeImpl(0x0); + markForTessellation(); if (is2D() && parent != null) { - ((PShapeOpenGL)parent).strokedTexture(false); + ((PShapeOpenGL)parent).strokedTexture(stroke && image != null); } } this.stroke = stroke; diff --git a/core/src/processing/opengl/PSurfaceJOGL.java b/core/src/processing/opengl/PSurfaceJOGL.java index 3727f3472..18f05214f 100644 --- a/core/src/processing/opengl/PSurfaceJOGL.java +++ b/core/src/processing/opengl/PSurfaceJOGL.java @@ -297,6 +297,21 @@ public class PSurfaceJOGL implements PSurface { sketch.displayWidth = screenRect.width; sketch.displayHeight = screenRect.height; + if (sketch.displayWidth < sketch.width || + sketch.displayHeight < sketch.height) { + int w = sketch.width; + int h = sketch.height; + if (sketch.displayWidth < w) { + w = sketch.displayWidth; + } + if (sketch.displayHeight < h) { + h = sketch.displayHeight; + } +// sketch.setSize(w, h - 22 - 2); +// graphics.setSize(w, h - 22 - 22); + System.err.println("setting width/height to " + w + " " + h); + } + sketchWidth = sketch.sketchWidth(); sketchHeight = sketch.sketchHeight();