From f05156b257f97d16a1d5bde3e4dba1f7e8db3f78 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sun, 4 May 2025 21:38:01 +0200 Subject: [PATCH] Update --- Meta | 2 +- Modules/Config.lua | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Meta b/Meta index ba3bf26..e5f4ad0 160000 --- a/Meta +++ b/Meta @@ -1 +1 @@ -Subproject commit ba3bf263d6cf555a1e4a20d9b8378a9e4fce26e2 +Subproject commit e5f4ad0cbc3884f91ba8c4856c6b46b48dc6f205 diff --git a/Modules/Config.lua b/Modules/Config.lua index 1b66621..02f9e4c 100644 --- a/Modules/Config.lua +++ b/Modules/Config.lua @@ -141,6 +141,7 @@ GridFrame = { if bestColumn then frame:SetParent(self.frame) + ---@diagnostic disable-next-line: inject-field frame.gridData = { row = bestRow, column = bestColumn, @@ -148,6 +149,7 @@ GridFrame = { rowspan = rowspan, parent = self, } + ---@diagnostic disable-next-line: inject-field, redefined-local frame.SetPos = function(self) if not self.gridData then return end local parent = self.gridData.parent @@ -176,24 +178,36 @@ GridFrame = { end end end, + ---@param self GridFrame + ---@param width number SetWidth = function(self, width) self.frame:SetWidth(width) self.cellWidth = width / self.columns self:Recalculate() end, + ---@param self GridFrame + ---@param height number SetHeight = function(self, height) self.frame:SetHeight(height) local tallestRow = 0 - for _, height in pairs(self.columnHeights) do - tallestRow = math.max(tallestRow, height) + for _, columnHeight in pairs(self.columnHeights) do + tallestRow = math.max(tallestRow, columnHeight) end if tallestRow > 0 then self.cellHeight = height / tallestRow end self:Recalculate() end, + ---@param self GridFrame + ---@param point string + ---@param relativeTo Frame + ---@param relativePoint string + ---@param offsetX number + ---@param offsetY number SetPoint = function(self, point, relativeTo, relativePoint, offsetX, offsetY) self.frame:SetPoint(point, relativeTo, relativePoint, offsetX, offsetY) self:Recalculate() end, + ---@param self GridFrame + ---@param parent Frame SetParent = function(self, parent) self.frame:SetParent(parent) self:Recalculate() @@ -274,7 +288,9 @@ StaticGridFrame = { if canPlace then local x = (col - 1) * self.cellWidth local y = -(row - 1) * self.cellHeight + ---@diagnostic disable-next-line: inject-field frame.colspan = colspan + ---@diagnostic disable-next-line: inject-field frame.rowspan = rowspan frame:SetWidth(self.cellWidth * colspan) frame:SetHeight(self.cellHeight * rowspan)