From 42b022af2aac81935b9dd23cfb6c95f74700c995 Mon Sep 17 00:00:00 2001 From: Chicken-Bomes Date: Fri, 24 Apr 2015 18:47:59 +1000 Subject: [PATCH] Add fontRenderer parameter to drawMultilineTip --- src/codechicken/lib/gui/GuiDraw.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/codechicken/lib/gui/GuiDraw.java b/src/codechicken/lib/gui/GuiDraw.java index fb0f2a3..bfb280d 100644 --- a/src/codechicken/lib/gui/GuiDraw.java +++ b/src/codechicken/lib/gui/GuiDraw.java @@ -158,6 +158,10 @@ public class GuiDraw } public static void drawMultilineTip(int x, int y, List list) { + drawMultilineTip(fontRenderer, x, y, list); + } + + public static void drawMultilineTip(FontRenderer font, int x, int y, List list) { if (list.isEmpty()) return; @@ -172,7 +176,7 @@ public class GuiDraw ITooltipLineHandler line = getTipLine(s); Dimension d = line != null ? line.getSize() : - new Dimension(getStringWidth(s), list.get(i).endsWith(TOOLTIP_LINESPACE) && i + 1 < list.size() ? 12 : 10); + new Dimension(font.getStringWidth(s), list.get(i).endsWith(TOOLTIP_LINESPACE) && i + 1 < list.size() ? 12 : 10); w = Math.max(w, d.width); h += d.height; } @@ -193,7 +197,7 @@ public class GuiDraw y += line.getSize().height; } else { - fontRenderer.drawStringWithShadow(s, x, y, -1); + font.drawStringWithShadow(s, x, y, -1); y += s.endsWith(TOOLTIP_LINESPACE) ? 12 : 10; } }