From 93485e15252a97807e2ed74522c8d49bf95cc76e Mon Sep 17 00:00:00 2001 From: SuperSoupr <26164930+SuperSoupr@users.noreply.github.com> Date: Fri, 14 Nov 2025 07:29:41 +0200 Subject: [PATCH] Clarify IWailaVariableWidthTooltipRenderer.getSize's documentation (#53) --- .../api/IWailaVariableWidthTooltipRenderer.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/mcp/mobius/waila/api/IWailaVariableWidthTooltipRenderer.java b/src/main/java/mcp/mobius/waila/api/IWailaVariableWidthTooltipRenderer.java index 95cc74d..9782c9b 100644 --- a/src/main/java/mcp/mobius/waila/api/IWailaVariableWidthTooltipRenderer.java +++ b/src/main/java/mcp/mobius/waila/api/IWailaVariableWidthTooltipRenderer.java @@ -1,5 +1,7 @@ package mcp.mobius.waila.api; +import java.awt.Dimension; + /** * Interface for tooltip renderers that adjust their width depending on the width of the rest of the tooltip. * setMaxLineWidth is called by {@link mcp.mobius.waila.overlay.Tooltip} before every tooltip render to inform the @@ -7,6 +9,17 @@ package mcp.mobius.waila.api; */ public interface IWailaVariableWidthTooltipRenderer extends IWailaTooltipRenderer { + /** + * Return the size of the tooltip. for variable width renderers it is recommended to return the minimum width needed + * for the line, then draw the actual width using getMaxLineWidth(). They do not need to actually match. + * + * @param params Array of string parameters as passed to the RENDER arg in the tooltip + * ({rendername,param1,param2,...}) + * @param accessor A global accessor for TileEntities and Entities + * @return Dimension of the reserved area + */ + Dimension getSize(String[] params, IWailaCommonAccessor accessor); + /** * Informs the renderer of what the length of the longest line is.
* Called by {@link mcp.mobius.waila.overlay.Tooltip} before every tooltip render.