Clear children in LocationOverlay
Clear children each frame in LocationOverlay to prevent infinite adding of components there. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -46,9 +46,10 @@ public class LocationOverlay extends Overlay
|
|||||||
@Inject
|
@Inject
|
||||||
LocationOverlay(Client client, DevToolsPlugin plugin)
|
LocationOverlay(Client client, DevToolsPlugin plugin)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.TOP_LEFT);
|
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
panelComponent.setPreferredSize(new Dimension(150, 0));
|
||||||
|
setPosition(OverlayPosition.TOP_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -59,8 +60,7 @@ public class LocationOverlay extends Overlay
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
panelComponent.setPreferredSize(new Dimension(150, 0));
|
panelComponent.getChildren().clear();
|
||||||
|
|
||||||
WorldPoint localWorld = client.getLocalPlayer().getWorldLocation();
|
WorldPoint localWorld = client.getLocalPlayer().getWorldLocation();
|
||||||
LocalPoint localPoint = client.getLocalPlayer().getLocalLocation();
|
LocalPoint localPoint = client.getLocalPlayer().getLocalLocation();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user