From 234f310dc19eaef87981fb3d0477df659fdf9a60 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Thu, 20 Nov 2014 18:01:48 -0500 Subject: [PATCH] additional workaround for Canvas-only code --- core/src/processing/core/PSurfaceAWT.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/processing/core/PSurfaceAWT.java b/core/src/processing/core/PSurfaceAWT.java index b5594d450..d40e2bda3 100644 --- a/core/src/processing/core/PSurfaceAWT.java +++ b/core/src/processing/core/PSurfaceAWT.java @@ -831,9 +831,13 @@ public class PSurfaceAWT implements PSurface { // canvas.setSize(wide, high); // frame.setSize(wide, high); - setFrameSize(); //wide, high); + if (frame != null) { // canvas only + setFrameSize(); //wide, high); + } setCanvasSize(); - frame.setLocationRelativeTo(null); + if (frame != null) { + frame.setLocationRelativeTo(null); + } GraphicsConfiguration gc = canvas.getGraphicsConfiguration(); // If not realized (off-screen, i.e the Color Selector Tool), gc will be null.