Skip to content

Commit

Permalink
Fixing crash in multibar indicators (CF issue #1266)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnpsp committed Dec 26, 2023
1 parent c1f3ac4 commit 842ef0a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions modules/IndicatorMultiBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ local function Bar_OnFrameUpdate(bar)
else
texture:Hide()
end
end
end
else
texture:Hide()
end
Expand Down Expand Up @@ -126,7 +126,7 @@ local function Bar_Update(self, parent, unit, status)
end
bar.myMaxIndex = #self.statuses
end
updates[bar] = true
updates[bar] = true
end
end
end
Expand Down Expand Up @@ -176,7 +176,7 @@ local function Bar_Layout(self, parent)
texture.myLineAdjust = setup.lineAdjust
texture:SetWidth ( self.orientation == "HORIZONTAL" and setup.lineSize or width )
texture:SetHeight( self.orientation ~= "HORIZONTAL" and setup.lineSize or height)
else
else
texture:SetSize(width, height)
end
textures[i] = texture
Expand Down Expand Up @@ -257,7 +257,7 @@ local function Bar_UpdateDB(self)
horAdjust = setup.horTile=='CLAMP',
verAdjust = setup.verTile=='CLAMP',
sublayer = setup.glowLine and 7 or i,
lineSize = setup.glowLine,
lineSize = setup.glowLine,
lineAdjust= setup.glowLine and (setup.glowLineAdjust or 0) or nil,
}
end
Expand Down Expand Up @@ -288,9 +288,11 @@ local function BarColor_SetBarColor(self, parent, r, g, b, a)
local bar = parent[self.parentName]
if bar then
local textures = bar.myCTextures
for i=#textures,1,-1 do
local tex = textures[i]
tex:SetVertexColor( r, g, b, min(tex.myOpacity, a or 1) )
if textures then
for i=#textures,1,-1 do
local tex = textures[i]
tex:SetVertexColor( r, g, b, min(tex.myOpacity, a or 1) )
end
end
end
end
Expand All @@ -299,7 +301,9 @@ local function BarColor_SetBarColorInverted(self, parent, r, g, b, a)
local bar = parent[self.parentName]
if bar then
local textures = bar.myTextures
textures[#textures]:SetVertexColor(r, g, b, a)
if textures then
textures[#textures]:SetVertexColor(r, g, b, a)
end
end
end

Expand Down

0 comments on commit 842ef0a

Please sign in to comment.