From 004d321c1562beede690a7bb10315fd6f753fc01 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 19 May 2022 09:52:43 -0400 Subject: [PATCH] widget overlay: use setForcedPosition The inventory can be moved pre-interface tick by the tli subchange listener, as well as post-our client tick event from script events running. This makes it difficult to correctly and generically move the interface, since it would have to be moved pre-interface tick and also pre-frame. Currently the code moves the interface pre-frame, which looks okay, but since it is ticking the interface when it is a different position, clicks on it do not work correctly. We do not have events for pre-interface tick, so use forced position to reliably set the position --- .../java/net/runelite/client/ui/overlay/WidgetOverlay.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java index 5806234f65..382ea1046a 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java @@ -136,8 +136,7 @@ public class WidgetOverlay extends Overlay if (getPreferredLocation() != null || getPreferredPosition() != null) { // The widget relative pos is relative to the parent - widget.setRelativeX(bounds.x - parent.x); - widget.setRelativeY(bounds.y - parent.y); + widget.setForcedPosition(bounds.x - parent.x, bounds.y - parent.y); } else { @@ -145,6 +144,7 @@ public class WidgetOverlay extends Overlay { revalidate = false; log.debug("Revalidating {}", widgetInfo); + widget.setForcedPosition(-1, -1); // Revalidate the widget to reposition it back to its normal location after an overlay reset widget.revalidate(); }