From 1c48af2ccd1fa69003fedd3b5c1c4997faeaee37 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sat, 16 May 2015 20:37:16 -0400 Subject: [PATCH] stage not necessarily inited yet --- core/src/processing/core/PSurfaceFX.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/processing/core/PSurfaceFX.java b/core/src/processing/core/PSurfaceFX.java index ade911db3..d435f15e6 100644 --- a/core/src/processing/core/PSurfaceFX.java +++ b/core/src/processing/core/PSurfaceFX.java @@ -103,6 +103,7 @@ public class PSurfaceFX implements PSurface { static public class PApplicationFX extends Application { static public PSurfaceFX surface; static String title; // title set at launch + static boolean resizable; // set at launch public PApplicationFX() { } @@ -159,7 +160,10 @@ public class PSurfaceFX implements PSurface { /** Set true if we want to resize things (default is not resizable) */ public void setResizable(boolean resizable) { - stage.setResizable(resizable); + PApplicationFX.resizable = resizable; + if (stage != null) { + stage.setResizable(resizable); + } } @@ -262,7 +266,6 @@ public class PSurfaceFX implements PSurface { // handle frame resizing events //setupFrameResizeListener(); - // TODO this is much too late... why even create the enormous frame for PDF? if (sketch.getGraphics().displayable()) { setVisible(true); }