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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user