mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
ignore Insets, not needed with JFrame like the are with awt.Frame
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user