Allows panels to cover the entire mapboard area (that is, all the frame except the menu bar). This is needed for some panels on very small screen.

This commit is contained in:
Stian Grenborgen 2023-06-11 11:32:46 +02:00
parent 77b71fdd6a
commit 6b976523ac
1 changed files with 2 additions and 3 deletions

View File

@ -310,9 +310,8 @@ public final class Canvas extends JDesktopPane {
}
private Dimension capSizeToMaximum(JInternalFrame f, Dimension maxSize) {
final int FRAME_EMPTY_SPACE = 60;
final int width = Math.max(f.getMinimumSize().width, Math.min(f.getWidth(), maxSize.width - FRAME_EMPTY_SPACE));
final int height = Math.max(f.getMinimumSize().height, Math.min(f.getHeight(), maxSize.height - FRAME_EMPTY_SPACE));
final int width = Math.max(f.getMinimumSize().width, Math.min(f.getWidth(), maxSize.width));
final int height = Math.max(f.getMinimumSize().height, Math.min(f.getHeight(), maxSize.height));
return new Dimension(width, height);
}