Skip to content

Commit e65bb37

Browse files
committed
can re-enable fill/stroke in PShapeOpenGL (fixes processing#3808)
1 parent 48b6626 commit e65bb37

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

core/src/processing/opengl/PShapeOpenGL.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,8 +1799,8 @@ public void setFill(boolean fill) {
17991799
PShapeOpenGL child = (PShapeOpenGL) children[i];
18001800
child.setFill(fill);
18011801
}
1802-
} else if (this.fill && !fill) {
1803-
setFillImpl(0x0);
1802+
} else if (this.fill != fill) {
1803+
markForTessellation();
18041804
}
18051805
this.fill = fill;
18061806
}
@@ -1981,16 +1981,9 @@ public void setStroke(boolean stroke) {
19811981
child.setStroke(stroke);
19821982
}
19831983
} else if (this.stroke != stroke) {
1984-
if (this.stroke) {
1985-
// Disabling stroke on a shape previously with
1986-
// stroke needs a re-tessellation in order to remove
1987-
// the additional geometry of lines and/or points.
1988-
markForTessellation();
1989-
stroke = false;
1990-
}
1991-
setStrokeImpl(0x0);
1984+
markForTessellation();
19921985
if (is2D() && parent != null) {
1993-
((PShapeOpenGL)parent).strokedTexture(false);
1986+
((PShapeOpenGL)parent).strokedTexture(stroke && image != null);
19941987
}
19951988
}
19961989
this.stroke = stroke;

core/src/processing/opengl/PSurfaceJOGL.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,21 @@ protected void initWindow() {
297297
sketch.displayWidth = screenRect.width;
298298
sketch.displayHeight = screenRect.height;
299299

300+
if (sketch.displayWidth < sketch.width ||
301+
sketch.displayHeight < sketch.height) {
302+
int w = sketch.width;
303+
int h = sketch.height;
304+
if (sketch.displayWidth < w) {
305+
w = sketch.displayWidth;
306+
}
307+
if (sketch.displayHeight < h) {
308+
h = sketch.displayHeight;
309+
}
310+
// sketch.setSize(w, h - 22 - 2);
311+
// graphics.setSize(w, h - 22 - 22);
312+
System.err.println("setting width/height to " + w + " " + h);
313+
}
314+
300315
sketchWidth = sketch.sketchWidth();
301316
sketchHeight = sketch.sketchHeight();
302317

0 commit comments

Comments
 (0)