Skip to content

Commit 3d3f48f

Browse files
committed
Add emmylua annotations to TooltipClass:CalculateColumns()
Disclaimer: I had an AI generate the texts for this one, as it's just busy work, but I did check the output for correctness and I do find the annotations generally helpful. You can totally leave out this commit though, if you prefer
1 parent 7505914 commit 3d3f48f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Classes/Tooltip.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,17 @@ function TooltipClass:GetDynamicSize(viewPort)
195195
return ttW + H_PAD, ttH + V_PAD
196196
end
197197

198+
--- Calculates the column breaks, layout heights, and individual rendering instructions for tooltip lines.
199+
--- By default, items exceeding window height will wrap to a new column.
200+
---@param ttY number Base y-coordinate for the tooltip content
201+
---@param ttX number Base x-coordinate for the tooltip content
202+
---@param ttH number The total estimated height of the tooltip content, used to determine column breakpoints
203+
---@param ttW number The pixel width of the primary (first) tooltip column
204+
---@param viewPort table A table `{x, y, width, height}` containing active screen boundaries
205+
---@return number columns The total number of layout columns generated
206+
---@return number maxColumnHeight The maximum pixel height reached across all formatted columns
207+
---@return table drawStack An array of sequential rendering instructions (texts, images, separators, and their coordinates)
208+
---@return number extraColumnWidth The required dynamic pixel width calculated for any additional columns beyond the first
198209
function TooltipClass:CalculateColumns(ttY, ttX, ttH, ttW, viewPort)
199210
local y = ttY + 2 * BORDER_WIDTH
200211
if self.titleYOffset then

0 commit comments

Comments
 (0)