Skip to content

Commit 484b46f

Browse files
committed
do initial setSize() call, fixes #395 (regression from #186)
1 parent 13bfeba commit 484b46f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

core/src/processing/awt/PGraphicsJava2D.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ public PGraphicsJava2D() { }
116116
*/
117117
@Override
118118
public void setSize(int w, int h) { // ignore
119+
// If this is the initial setup, need to assign width/height;
120+
// especially necessary for renderer subclasses.
121+
// https://github.com/processing/processing4/issues/395
122+
if (width == 0 || height == 0) {
123+
super.setSize(w, h);
124+
}
119125
sizeChange = new Dimension(w, h);
120126
}
121127

0 commit comments

Comments
 (0)