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.
This commit is contained in:
Seth
2018-04-03 16:58:48 -05:00
parent a8a2b1bd15
commit ad4546b816

View File

@@ -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());