Skip to content

Commit

Permalink
Added a small guard for a divide by 0 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Cidan committed Nov 5, 2023
1 parent 09c9e00 commit 09e2b6e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions widgets/ContainerFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ function containerProto:ResizeToSortSection(forceLayout)
end
local width = max(self.Content:GetWidth(), self.minWidth or 0)
local numCols = floor((width + ITEM_SPACING) / (ITEM_SIZE + ITEM_SPACING))
if numCols == 0 then numCols = 1 end
local resized = section:SetSizeInSlots(numCols, ceil(section.count / numCols))
section:Show()
if forceLayout or resized or not section:IsShown() then
Expand Down

0 comments on commit 09e2b6e

Please sign in to comment.