diff --git a/Modules/Unitframes/Auras.lua b/Modules/Unitframes/Auras.lua index f745c76..2becd86 100644 --- a/Modules/Unitframes/Auras.lua +++ b/Modules/Unitframes/Auras.lua @@ -401,59 +401,68 @@ function mod:UpdateCenteredAuras(enable) isVertical = true, firstInRowPoint = 'BOTTOM', subsequentPoint = 'BOTTOMLEFT', - framePoint = 'BOTTOM' + framePoint = 'BOTTOM', + growthX = 1, }, ["TOP"] = { isVertical = true, firstInRowPoint = 'BOTTOM', subsequentPoint = 'BOTTOMLEFT', - framePoint = 'BOTTOM' + framePoint = 'BOTTOM', + growthX = 1, }, ["BOTTOM"] = { isVertical = true, isReverse = true, firstInRowPoint = 'TOP', subsequentPoint = 'TOPLEFT', - framePoint = 'TOP' + framePoint = 'TOP', + growthX = 1, }, ["LEFT"] = { isVertical = false, firstInRowPoint = 'RIGHT', subsequentPoint = 'TOPRIGHT', - framePoint = 'RIGHT' + framePoint = 'RIGHT', + growthX = 1, }, ["RIGHT"] = { isVertical = false, isReverse = true, firstInRowPoint = 'LEFT', subsequentPoint = 'TOPLEFT', - framePoint = 'LEFT' + framePoint = 'LEFT', + growthX = -1, }, ["TOPLEFT"] = { isVertical = true, firstInRowPoint = 'BOTTOM', subsequentPoint = 'BOTTOMLEFT', - framePoint = 'BOTTOM' + framePoint = 'BOTTOM', + growthX = 1, }, ["TOPRIGHT"] = { isVertical = true, firstInRowPoint = 'BOTTOM', subsequentPoint = 'BOTTOMLEFT', - framePoint = 'BOTTOM' + framePoint = 'BOTTOM', + growthX = -1, }, ["BOTTOMLEFT"] = { isVertical = true, isReverse = true, firstInRowPoint = 'TOP', subsequentPoint = 'TOPLEFT', - framePoint = 'TOP' + framePoint = 'TOP', + growthX = 1, }, ["BOTTOMRIGHT"] = { isVertical = true, isReverse = true, firstInRowPoint = 'TOP', subsequentPoint = 'TOPLEFT', - framePoint = 'TOP' + framePoint = 'TOP', + growthX = -1, } } @@ -461,11 +470,13 @@ function mod:UpdateCenteredAuras(enable) if not numElements or perRow == 1 then return end local anchorPoint = frame.anchorPoint - local isVertical = directionProperties[anchorPoint].isVertical - local isReverse = directionProperties[anchorPoint].isReverse - local firstInRowPoint = directionProperties[anchorPoint].firstInRowPoint - local subsequentPoint = directionProperties[anchorPoint].subsequentPoint - local framePoint = directionProperties[anchorPoint].framePoint + local points = directionProperties[anchorPoint] + local isVertical = points.isVertical + local isReverse = points.isReverse + local firstInRowPoint = points.firstInRowPoint + local subsequentPoint = points.subsequentPoint + local framePoint = points.framePoint + local growthX = points.growthX for i = 1, numElements do local child = frame[i] @@ -474,12 +485,12 @@ function mod:UpdateCenteredAuras(enable) if i == (perRow * floor(i / perRow) + 1) then local numOtherRow = min(perRow, (numElements - (perRow * floor(i / perRow)))) local OtherRowSize = (numOtherRow * offset) - local xOffset = isVertical and -(OtherRowSize - offset) / 2 or ((isReverse and 1 or -1) * offset * floor(i / perRow)) + local xOffset = (isVertical and -(OtherRowSize - offset) / 2 or ((isReverse and 1 or -1) * offset * floor(i / perRow))) * growthX local yOffset = isVertical and ((isReverse and -1 or 1) * offset * floor(i / perRow)) or -(OtherRowSize - offset) / 2 child:Point(firstInRowPoint, frame, framePoint, xOffset, yOffset) anchorPoint = child else - local xOffset = isVertical and offset or 0 + local xOffset = (isVertical and offset or 0) * growthX local yOffset = isVertical and 0 or offset child:Point(subsequentPoint, anchorPoint, subsequentPoint, xOffset, yOffset) anchorPoint = child @@ -871,4 +882,4 @@ function mod:InitializeCallback() mod:Toggle(db) end -core.modules[modName] = mod.InitializeCallback \ No newline at end of file +core.modules[modName] = mod.InitializeCallback