diff --git a/UnitFrames/EditMode.lua b/UnitFrames/EditMode.lua index f551c6d..cd9defa 100644 --- a/UnitFrames/EditMode.lua +++ b/UnitFrames/EditMode.lua @@ -303,6 +303,16 @@ local function CreateOverlayBox(button, unit) CUF:Fire("UpdateLayout", nil, "position", const.UNIT.TARGET) end + if Util:ButtonIsAnchoredToParent(unit) then + CUF.DB.CurrentLayoutTable()[unit].anchorToParent = false + CUF:Fire("UpdateLayout", nil, "position", unit) + end + + if Util:ButtonIsMirrored(unit) then + CUF.DB.CurrentLayoutTable()[unit].mirrorPlayer = false + CUF:Fire("UpdateLayout", nil, "position", unit) + end + UpdatePositioningPopup() end) diff --git a/Util/Utils.lua b/Util/Utils.lua index b5cee9e..6914dfc 100644 --- a/Util/Utils.lua +++ b/Util/Utils.lua @@ -319,6 +319,16 @@ function Util:IsPropSameType(a, b) return type(a) == type(b) end +---@param unit Unit +function Util:ButtonIsAnchoredToParent(unit) + return DB.CurrentLayoutTable()[unit].anchorToParent +end + +---@param unit Unit +function Util:ButtonIsMirrored(unit) + return DB.CurrentLayoutTable()[unit].mirrorPlayer +end + ------------------------------------------------- -- MARK: Frames -------------------------------------------------