From 4e22cb320117684963700a71eeeaf9803a32209e Mon Sep 17 00:00:00 2001 From: shagu Date: Thu, 22 Dec 2022 10:55:20 +0100 Subject: [PATCH] skin: check values before comparing them This fixes an addon conflict with aero [1], which is used to animate frames, causing them to have invalid GetRight() values for a short amount of time. [1] https://github.com/gashole/Aero --- modules/skin.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/skin.lua b/modules/skin.lua index 72740648..62cfcbca 100644 --- a/modules/skin.lua +++ b/modules/skin.lua @@ -4,12 +4,15 @@ pfUI:RegisterModule("skin", "vanilla:tbc", function () pfUI.panelalign:SetScript("OnUpdate", function() local left = UIParent.left local center = UIParent.center + local rbpos, ropos -- detect outer frame backdrops if left and not left.rightObj then left.rightObj = left.backdrop or left for _, frame in pairs({left:GetChildren()}) do - if frame.backdrop and frame.backdrop.GetRight and frame.backdrop:GetRight() > left.rightObj:GetRight() then + rbpos = frame.backdrop and frame.backdrop.GetRight and frame.backdrop:GetRight() + ropos = left.rightObj and left.rightObj.GetRight and left.rightObj:GetRight() + if rbpos and ropos and rbpos > ropos then left.rightObj = frame.backdrop end end