Skip to content

Commit

Permalink
Fix a case were sorting auras would result in spacing.
Browse files Browse the repository at this point in the history
This was because the sort function potentially could move icons outside the range :SetAuraPosition() would operate on. A simple example of this happening would be:
Pre sorting:
1:'visibleAura'
2:'visibleAura'
3:'inactiveAura'
4:'inactiveAura'
5:'inactiveAura'

Post sorting:
1:'visibleAura'
2:'inactiveAura'
3:'inactiveAura'
4:'visibleAura'
5:'inactiveAura'

The iterator would only try to position icon 1 and 2, thus leaving a space of two empty icons. The position remained correct due to the fact that oUF doesn't clear old positions. Ironically the fix is a ~3 liner...
  • Loading branch information
haste committed Dec 2, 2009
1 parent 2899977 commit f91cf5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion elements/aura.lua
Expand Up @@ -206,7 +206,7 @@ local SetAuraPosition = function(self, icons, x)
local cols = math.floor(icons:GetWidth() / size + .5)
local rows = math.floor(icons:GetHeight() / size + .5)

for i = 1, x do
for i = 1, #icons do
local button = icons[i]
if(button and button:IsShown()) then
if(gap and button.debuff) then
Expand All @@ -225,6 +225,8 @@ local SetAuraPosition = function(self, icons, x)
button:SetPoint(anchor, icons, anchor, col * size * growthx, row * size * growthy)

col = col + 1
elseif(not button) then
break
end
end
end
Expand Down

0 comments on commit f91cf5f

Please sign in to comment.