Skip to content

Commit 5290637

Browse files
use getWidth() instead of getSize().width
1 parent a840e92 commit 5290637

File tree

1 file changed

+1
-1
lines changed
  • enigma-swing/src/main/java/org/quiltmc/enigma/gui

1 file changed

+1
-1
lines changed

enigma-swing/src/main/java/org/quiltmc/enigma/gui/Gui.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ private void setupUi() {
238238
final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
239239

240240
// keep the whole width (or as much as will fit) on-screen so window controls in the title bar are accessible
241-
final int clampedX = Utils.clamp(windowPos.x, 0, Math.max(0, screenSize.width - frame.getSize().width));
241+
final int clampedX = Utils.clamp(windowPos.x, 0, Math.max(0, screenSize.width - frame.getWidth()));
242242
// allow some of the bottom to be off-screen, but not the top, because of the title bar
243243
final int clampedY = Utils.clamp(windowPos.y, 0, screenSize.height - ScaleUtil.scale(DEFAULT_MIN_TOP_ON_SCREEN));
244244

0 commit comments

Comments
 (0)