Commit e1a0de35 authored by Simpy's avatar Simpy 🐹
Browse files

arrange the math here, looking to fix its vertical offset atm

parent 1d12afe8
......@@ -634,18 +634,25 @@ function UF.groupPrototype:Configure_Groups(Header)
local width, height, newCols, newRows = 0, 0, 0, 0
local direction, dbWidth, dbHeight = db.growthDirection, db.width, db.height
local xMult, yMult = DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER[direction], DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER[direction]
local UNIT_HEIGHT = dbHeight + (db.infoPanel and db.infoPanel.enable and db.infoPanel.height or 0)
local groupBy = db.groupBy
local groupSpacing = db.groupSpacing
local groupsPerRowCol = db.groupsPerRowCol
local horizontalSpacing = db.horizontalSpacing
local invertGroupingOrder = db.invertGroupingOrder
local startFromCenter = db.startFromCenter
local raidWideSorting = db.raidWideSorting
local showPlayer = db.showPlayer
local sortDir = db.sortDir
local startFromCenter = db.startFromCenter
local groupSpacing = db.groupSpacing
local verticalSpacing = db.verticalSpacing
local horizontalSpacing = db.horizontalSpacing
local HEIGHT = dbHeight + verticalSpacing + (db.infoPanel and db.infoPanel.enable and db.infoPanel.height or 0)
local WIDTH = dbWidth + horizontalSpacing
local HEIGHT_FIVE = HEIGHT * 5
local WIDTH_FIVE = WIDTH * 5
local numGroups = Header.numGroups
for i = 1, numGroups do
......@@ -660,12 +667,12 @@ function UF.groupPrototype:Configure_Groups(Header)
group:SetAttribute('point', point)
if point == 'LEFT' or point == 'RIGHT' then
group:SetAttribute('xOffset', horizontalSpacing * DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER[direction])
group:SetAttribute('xOffset', horizontalSpacing * xMult)
group:SetAttribute('yOffset', 0)
group:SetAttribute('columnSpacing', verticalSpacing)
else
group:SetAttribute('xOffset', 0)
group:SetAttribute('yOffset', verticalSpacing * DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER[direction])
group:SetAttribute('yOffset', verticalSpacing * yMult)
group:SetAttribute('columnSpacing', horizontalSpacing)
end
......@@ -705,37 +712,37 @@ function UF.groupPrototype:Configure_Groups(Header)
if (i - 1) % groupsPerRowCol == 0 then
if DIRECTION_TO_POINT[direction] == 'LEFT' or DIRECTION_TO_POINT[direction] == 'RIGHT' then
if group then group:Point(point, Header, point, 0, height * yMult) end
height = height + UNIT_HEIGHT + verticalSpacing + groupSpacing
height = height + HEIGHT + groupSpacing
newRows = newRows + 1
else
if group then group:Point(point, Header, point, width * xMult, 0) end
width = width + dbWidth + horizontalSpacing + groupSpacing
width = width + WIDTH + groupSpacing
newCols = newCols + 1
end
else
if DIRECTION_TO_POINT[direction] == 'LEFT' or DIRECTION_TO_POINT[direction] == 'RIGHT' then
if newRows == 1 then
if group then group:Point(point, Header, point, width * xMult, 0) end
width = width + ((dbWidth + horizontalSpacing) * 5) + groupSpacing
width = width + WIDTH_FIVE + groupSpacing
newCols = newCols + 1
elseif group then
group:Point(point, Header, point, ((((dbWidth + horizontalSpacing) * 5) * ((i-1) % groupsPerRowCol))+((i-1) % groupsPerRowCol)*groupSpacing) * xMult, (((UNIT_HEIGHT + verticalSpacing+groupSpacing) * (newRows - 1))) * yMult)
group:Point(point, Header, point, ((WIDTH_FIVE * ((i-1) % groupsPerRowCol))+((i-1) % groupsPerRowCol)*groupSpacing) * xMult, (((HEIGHT+groupSpacing) * (newRows - 1))) * yMult)
end
else
if newCols == 1 then
if group then group:Point(point, Header, point, 0, height * yMult) end
height = height + ((UNIT_HEIGHT + verticalSpacing) * 5) + groupSpacing
height = height + HEIGHT_FIVE + groupSpacing
newRows = newRows + 1
elseif group then
group:Point(point, Header, point, (((dbWidth + horizontalSpacing +groupSpacing) * (newCols - 1))) * xMult, ((((UNIT_HEIGHT + verticalSpacing) * 5) * ((i-1) % groupsPerRowCol))+((i-1) % groupsPerRowCol)*groupSpacing) * yMult)
group:Point(point, Header, point, (((WIDTH+groupSpacing) * (newCols - 1))) * xMult, ((HEIGHT_FIVE * ((i-1) % groupsPerRowCol))+((i-1) % groupsPerRowCol)*groupSpacing) * yMult)
end
end
end
if height == 0 then
height = height + ((UNIT_HEIGHT + verticalSpacing) * 5) +groupSpacing
height = height + HEIGHT_FIVE + groupSpacing
elseif width == 0 then
width = width + ((dbWidth + horizontalSpacing) * 5) +groupSpacing
width = width + WIDTH_FIVE +groupSpacing
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment