From 9266274c1646adaa0a28bc3312429555516d3bb6 Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Tue, 25 Jan 2022 20:01:42 +0100 Subject: [PATCH] legacy to newlayout fix when frame has width = 0 or height = 0 --- Frame.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Frame.lua b/Frame.lua index 4baab81..84f5453 100644 --- a/Frame.lua +++ b/Frame.lua @@ -368,6 +368,10 @@ function Gladdy:SetPosition(frame, unit, xOffsetDB, yOffsetDB, newLayout, module if (not newLayout) then --Gladdy:Debug("INFO", name, "old X/Y:", frame:GetCenter()) local xOffset, yOffset = frame:GetLeft(), frame:GetTop() + if not xOffset or not yOffset then + xOffset = frame:GetCenter() - frame:GetWidth()/2 + yOffset = select(2, frame:GetCenter()) + frame:GetHeight()/2 + end local x,y = button.healthBar:GetLeft(), button.healthBar:GetTop() local newXOffset = math_abs(x - xOffset) * (x > xOffset and -1 or 1) local newYOffset = math_abs(y - yOffset) * (y > yOffset and -1 or 1)