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
This commit is contained in:
shagu
2022-12-22 10:55:20 +01:00
parent f0d1abef9c
commit 4e22cb3201
+4 -1
View File
@@ -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