Skip to content

Commit

Permalink
Fixing padding of smart centered icons in "Icons" indicator(gh issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnpsp committed Jun 27, 2024
1 parent 40751da commit fcfda32
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions modules/IndicatorIcons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ local function Icon_Layout(self, parent)
local size = iconSize + self.iconSpacing
local tc1,tc2,tc3,tc4 = Grid2.statusPrototype.GetTexCoord()
local level = parent:GetFrameLevel() + self.frameLevel
if self.smartCenter then
self.cellSize = size
f.SetSmartSize = self.vertical and f.SetHeight or f.SetWidth
end
if not self.dbx.disableOmniCC then
local i,j = parent:GetName():match("Grid2LayoutHeader(%d+)UnitButton(%d+)")
frameName = format( "Grid2Icons%s%02d%02d", self.name:gsub("%-","") , i, j )
Expand All @@ -143,7 +139,16 @@ local function Icon_Layout(self, parent)
f:ClearAllPoints()
f:SetPoint(self.anchor, parent.container, self.anchorRel, self.offsetx, self.offsety)
f:SetFrameLevel(level)
f:SetSize( size*self.pw, size*self.ph )
self.cellSize = size
if not self.smartCenter then
f:SetSize( size*self.pw, size*self.ph )
elseif self.vertical then
f:SetWidth(iconSize)
f.SetSmartSize = f.SetHeight
else
f:SetHeight(iconSize)
f.SetSmartSize = f.SetWidth
end
local auras = f.auras
for i=1,self.maxIcons do
local frame = auras[i]
Expand Down Expand Up @@ -237,7 +242,7 @@ local function Icon_UpdateDB(self)
self.vx = 0
self.ux = pointsX[self.anchorIcon]
self.vy = pointsY[self.anchorIcon]
self.pw = math.abs(self.ux)*self.maxIconsPerRow
self.pw = math.abs(self.ux)*math.min(self.maxIcons, self.maxIconsPerRow)
self.ph = math.abs(self.vy)*self.maxRows
if self.vertical then
self.ux, self.vx = self.vx, self.ux
Expand Down

0 comments on commit fcfda32

Please sign in to comment.