diff --git a/Frame.lua b/Frame.lua index 2713510..e236d2e 100644 --- a/Frame.lua +++ b/Frame.lua @@ -134,6 +134,8 @@ function Gladdy:UpdateFrame() local height = (self.db.healthBarHeight + powerBarHeight) * teamSize + (self.db.highlightInset and 0 or self.db.highlightBorderSize * 2 * teamSize) + self.db.bottomMargin * (teamSize - 1) + local singleFrameHeight = self.db.healthBarHeight + powerBarHeight + + (self.db.highlightInset and 0 or self.db.highlightBorderSize * 2) + self.db.bottomMargin -- Highlight margin = margin + highlightBorderSize @@ -155,10 +157,13 @@ function Gladdy:UpdateFrame() self.frame:SetPoint("CENTER") else local scale = self.frame:GetEffectiveScale() + local growMiddle = self.db.growMiddle and teamSize > 0 and teamSize / 2 >= 1 and (teamSize - 1) * (singleFrameHeight / 2) or 0 if (self.db.growDirection == "TOP") then - self.frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, self.db.y / scale) + self.frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, (self.db.y / scale) - growMiddle) + elseif self.db.growDirection == "BOTTOM" then + self.frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, (self.db.y / scale) + growMiddle) else - self.frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, self.db.y / scale) + self.frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", self.db.x / scale, (self.db.y / scale)) end end diff --git a/Options.lua b/Options.lua index ea4c3a3..78f78e1 100644 --- a/Options.lua +++ b/Options.lua @@ -48,6 +48,7 @@ Gladdy.defaults = { x = 0, y = 0, growDirection = "BOTTOM", + growMiddle = false, frameScale = 1, pixelPerfect = false, barWidth = 180, @@ -311,7 +312,7 @@ function Gladdy:SetupOptions() group = { type = "group", name = L["General"], - order = 5, + order = 6, childGroups = "tree", args = { frameGeneral = { @@ -322,6 +323,12 @@ function Gladdy:SetupOptions() headerFrame = { type = "header", name = L["Frame General"], + order = 2, + }, + growMiddle = { + type = "toggle", + name = L["Grow Middle"], + desc = L["Frames expand along a centric anchor"], order = 3, }, pixelPerfect = {