do initial setSize() call, fixes #395 (regression from #186)

This commit is contained in:
Ben Fry
2022-02-06 07:41:14 -05:00
parent 13bfebac74
commit 484b46f7c6
@@ -116,6 +116,12 @@ public class PGraphicsJava2D extends PGraphics {
*/
@Override
public void setSize(int w, int h) { // ignore
// If this is the initial setup, need to assign width/height;
// especially necessary for renderer subclasses.
// https://github.com/processing/processing4/issues/395
if (width == 0 || height == 0) {
super.setSize(w, h);
}
sizeChange = new Dimension(w, h);
}