diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java index 040e37b14f..4e96aa08b8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsOverlay.java @@ -127,6 +127,7 @@ public class PlayerIndicatorsOverlay extends Overlay OverlayUtil.renderActorTextAndImage(graphics, actor, builtString, color, ImageUtil.resizeImage(Objects.requireNonNull(clanManager .getClanImage(clanManager.getRank(actor.getName()))), y, y), 0, ACTOR_HORIZONTAL_TEXT_MARGIN); + return; } } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayUtil.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayUtil.java index e95f9bc45f..8917b89114 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayUtil.java @@ -286,14 +286,14 @@ public class OverlayUtil public static void renderActorTextAndImage(Graphics2D graphics, Actor actor, String text, Color color, BufferedImage image, int yOffset, int xOffset) { - Point textLocation = new Point(actor.getConvexHull().getBounds().x + xOffset, - actor.getConvexHull().getBounds().y + yOffset); + Point textLocation = actor.getCanvasTextLocation(graphics, text, actor.getLogicalHeight() + yOffset); - renderImageLocation(graphics, textLocation, image); - xOffset = image.getWidth() + 1; - yOffset = (image.getHeight() - (int) graphics.getFontMetrics().getStringBounds(text, graphics).getHeight()); - textLocation = new Point(textLocation.getX() + xOffset, textLocation.getY() + image.getHeight() - yOffset); - renderTextLocation(graphics, textLocation, text, color); + if (textLocation != null) + { + renderImageLocation(graphics, textLocation, image); + textLocation = new Point(textLocation.getX() + xOffset , textLocation.getY()); + renderTextLocation(graphics, textLocation, text, color); + } } public static void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint, boolean shadows, int yOffset)