can re-enable fill/stroke in PShapeOpenGL (fixes #3808)

This commit is contained in:
codeanticode
2015-09-18 18:09:37 -05:00
parent c580c6475c
commit e61178f71e
2 changed files with 19 additions and 11 deletions

View File

@@ -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;

View File

@@ -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();