From 3bbc18299e03e6b7259ba00e8cc4cd4ca7348759 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Thu, 8 Mar 2018 00:39:16 +0100 Subject: [PATCH] Set correct offsets to overlays, smaller panels - Set correct offsets for overlays based on resizable or fixed mode - Change PanelComponent inside padding to be slighly smaller Signed-off-by: Tomas Slusny --- .../client/ui/overlay/OverlayRenderer.java | 18 ++++++++++++------ .../components/ImagePanelComponent.java | 8 ++++---- .../ui/overlay/components/PanelComponent.java | 10 +++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java index 5c8df59c07..c4c55dfdb1 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java @@ -58,8 +58,11 @@ import net.runelite.client.ui.overlay.tooltip.TooltipOverlay; @Slf4j public class OverlayRenderer { - private static final int BORDER_TOP = 25; - private static final int BORDER_LEFT = 5; + private static final int BORDER_LEFT_RESIZABLE = 5; + private static final int BORDER_TOP_RESIZABLE = 20; + private static final int FRAME_OFFSET = 4; + private static final int BORDER_LEFT_FIXED = BORDER_LEFT_RESIZABLE + FRAME_OFFSET; + private static final int BORDER_TOP_FIXED = BORDER_TOP_RESIZABLE + FRAME_OFFSET; private static final int BORDER_RIGHT = 2; private static final int BORDER_BOTTOM = 2; private static final int PADDING = 2; @@ -192,6 +195,7 @@ public class OverlayRenderer return; } + final boolean isResizeable = client.isResized(); final Widget viewport = client.getViewportWidget(); final Rectangle bounds = viewport != null ? new Rectangle(viewport.getBounds()) @@ -203,18 +207,20 @@ public class OverlayRenderer OverlayUtil.setGraphicProperties(graphics); final Point topLeftPoint = new Point(); - topLeftPoint.move(BORDER_LEFT, BORDER_TOP); + topLeftPoint.move( + isResizeable ? BORDER_LEFT_RESIZABLE : BORDER_LEFT_FIXED, + isResizeable ? BORDER_TOP_RESIZABLE : BORDER_TOP_FIXED); final Point topRightPoint = new Point(); - topRightPoint.move(bounds.x + bounds.width - BORDER_RIGHT, BORDER_TOP); + topRightPoint.move(bounds.x + bounds.width - BORDER_RIGHT, BORDER_TOP_FIXED); final Point bottomLeftPoint = new Point(); - bottomLeftPoint.move(BORDER_LEFT, bounds.y + bounds.height - BORDER_BOTTOM); + bottomLeftPoint.move(isResizeable ? BORDER_LEFT_RESIZABLE : BORDER_LEFT_FIXED, bounds.y + bounds.height - BORDER_BOTTOM); final Point bottomRightPoint = new Point(); bottomRightPoint.move(bounds.x + bounds.width - BORDER_RIGHT, bounds.y + bounds.height - BORDER_BOTTOM); final Point rightChatboxPoint = new Point(); rightChatboxPoint.move(bounds.x + chatboxBounds.width - BORDER_RIGHT, bounds.y + bounds.height - BORDER_BOTTOM); //check to see if Chatbox is minimized - if (chatbox != null && client.isResized() && chatbox.isHidden()) + if (chatbox != null && isResizeable && chatbox.isHidden()) { rightChatboxPoint.y += chatboxBounds.height; bottomLeftPoint.y += chatboxBounds.height; diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImagePanelComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImagePanelComponent.java index 55d44bf0a7..2fcfee2b20 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImagePanelComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImagePanelComponent.java @@ -41,10 +41,10 @@ import net.runelite.client.ui.overlay.RenderableEntity; public class ImagePanelComponent implements RenderableEntity { - private static final int TOP_BORDER = 3; - private static final int SIDE_BORDER = 6; - private static final int BOTTOM_BORDER = 6; - private static final int SEPARATOR = 4; + private static final int TOP_BORDER = 4; + private static final int SIDE_BORDER = 4; + private static final int BOTTOM_BORDER = 4; + private static final int SEPARATOR = 1; @Setter @Nullable diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java index 80d528b099..d53978a5ba 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java @@ -43,11 +43,11 @@ import net.runelite.client.ui.overlay.RenderableEntity; public class PanelComponent implements RenderableEntity { - private static final int TOP_BORDER = 3; - private static final int LEFT_BORDER = 6; - private static final int RIGHT_BORDER = 6; - private static final int BOTTOM_BORDER = 6; - private static final int SEPARATOR = 2; + private static final int TOP_BORDER = 4; + private static final int LEFT_BORDER = 4; + private static final int RIGHT_BORDER = 4; + private static final int BOTTOM_BORDER = 4; + private static final int SEPARATOR = 1; @Data @AllArgsConstructor