From a41074f1355dbb785dc4808eee97b487e7adc0cf Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 28 Jul 2020 13:42:44 -0400 Subject: [PATCH] clientui: use contains instead of intersects for screen bounds checking It is possible to have the client bounds intersect the screen bounds but still have the client unusable due to being unable to resposition it. --- .../src/main/java/net/runelite/client/ui/ClientUI.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java index aac0c62bc9..99a5baf689 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java @@ -522,8 +522,8 @@ public class ClientUI frame.setBounds(clientBounds); // frame.getGraphicsConfiguration().getBounds() returns the bounds for the primary display. - // We have to find the correct graphics configuration by using the intersection of the client boundaries. - GraphicsConfiguration gc = getIntersectingDisplay(clientBounds); + // We have to find the correct graphics configuration by using the client boundaries. + GraphicsConfiguration gc = findDisplayFromBounds(clientBounds); if (gc != null) { double scale = gc.getDefaultTransform().getScaleX(); @@ -587,7 +587,7 @@ public class ClientUI } } - private GraphicsConfiguration getIntersectingDisplay(final Rectangle bounds) + private GraphicsConfiguration findDisplayFromBounds(final Rectangle bounds) { GraphicsDevice[] gds = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); @@ -596,7 +596,7 @@ public class ClientUI GraphicsConfiguration gc = gd.getDefaultConfiguration(); final Rectangle displayBounds = gc.getBounds(); - if (displayBounds.intersects(bounds)) + if (displayBounds.contains(bounds)) { return gc; }