From 3fc5a788252174e151bab34ea04b6c2cf5faf03a Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Wed, 24 Jul 2013 10:52:54 -0400 Subject: [PATCH] ignore Insets, not needed with JFrame like the are with awt.Frame --- core/src/processing/core/PApplet.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 4211a1c83..bd32a99e4 100755 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -10596,12 +10596,13 @@ public class PApplet extends Applet // can't do pack earlier cuz present mode don't like it // (can't go full screen with a frame after calling pack) // frame.pack(); // get insets. get more. - Insets insets = frame.getInsets(); - - int windowW = Math.max(applet.width, MIN_WINDOW_WIDTH) + - insets.left + insets.right; - int windowH = Math.max(applet.height, MIN_WINDOW_HEIGHT) + - insets.top + insets.bottom; +// Insets insets = frame.getInsets(); +// int windowW = Math.max(applet.width, MIN_WINDOW_WIDTH) + +// insets.left + insets.right; +// int windowH = Math.max(applet.height, MIN_WINDOW_HEIGHT) + +// insets.top + insets.bottom; + int windowW = Math.max(applet.width, MIN_WINDOW_WIDTH); + int windowH = Math.max(applet.height, MIN_WINDOW_HEIGHT); frame.setSize(windowW, windowH); @@ -10654,9 +10655,12 @@ public class PApplet extends Applet frame.setBackground(backgroundColor); } - int usableWindowH = windowH - insets.top - insets.bottom; +// int usableWindowH = windowH - insets.top - insets.bottom; +// applet.setBounds((windowW - applet.width)/2, +// insets.top + (usableWindowH - applet.height)/2, +// applet.width, applet.height); applet.setBounds((windowW - applet.width)/2, - insets.top + (usableWindowH - applet.height)/2, + (windowH - applet.height)/2, applet.width, applet.height); if (external) {