From ad4546b816e28cc06356eb8beacc32e9e5baed27 Mon Sep 17 00:00:00 2001 From: Seth Date: Tue, 3 Apr 2018 16:58:48 -0500 Subject: [PATCH] ground item overlay: Fix boxes appearing very small with small font The box was based off the width of the font, which made the box super small when using the small RS font. This will provide a fixed rectangle size on any font. --- .../client/plugins/grounditems/GroundItemsOverlay.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java index 35d445262e..b753cefd2a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java @@ -167,23 +167,22 @@ public class GroundItemsOverlay extends Overlay { final int stringWidth = fm.stringWidth(itemString); final int stringHeight = fm.getHeight(); - final int descent = fm.getDescent(); // Hidden box final Rectangle itemHiddenBox = new Rectangle( textX + stringWidth, - textY - (stringHeight / 2) - descent, + textY - (RECTANGLE_SIZE + stringHeight) / 2, RECTANGLE_SIZE, - stringHeight / 2); + RECTANGLE_SIZE); plugin.getHiddenBoxes().put(itemHiddenBox, item.getName()); // Highlight box final Rectangle itemHighlightBox = new Rectangle( textX + stringWidth + RECTANGLE_SIZE + 2, - textY - (stringHeight / 2) - descent, + textY - (RECTANGLE_SIZE + stringHeight) / 2, RECTANGLE_SIZE, - stringHeight / 2); + RECTANGLE_SIZE); plugin.getHighlightBoxes().put(itemHighlightBox, item.getName());