castbar: dodge oversized unitframe portraits

This commit is contained in:
shagu
2025-07-24 09:30:44 +02:00
parent 3af870a225
commit 01c7d68db9
+9 -6
View File
@@ -213,8 +213,9 @@ pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
pfUI.castbar.player.spacing = default_border * 2 + tonumber(C.unitframes.player.pspace) * GetPerfectPixel()
if pfUI.uf.player then
local width = C.castbar.player.width ~= "-1" and C.castbar.player.width or pfUI.uf.player:GetWidth()
pfUI.castbar.player:SetPoint("TOPLEFT", pfUI.uf.player, "BOTTOMLEFT", 0, -pfUI.castbar.player.spacing)
local anchor = pfUI.uf.player.portrait:GetHeight() > pfUI.uf.player:GetHeight() and pfUI.uf.player.power or pfUI.uf.player
local width = C.castbar.player.width ~= "-1" and C.castbar.player.width or anchor:GetWidth()
pfUI.castbar.player:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", 0, -pfUI.castbar.player.spacing)
pfUI.castbar.player:SetWidth(width)
else
local width = C.castbar.player.width ~= "-1" and C.castbar.player.width or 200
@@ -240,8 +241,9 @@ pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
pfUI.castbar.target.spacing = default_border * 2 + tonumber(C.unitframes.target.pspace) * GetPerfectPixel()
if pfUI.uf.target then
local width = C.castbar.target.width ~= "-1" and C.castbar.target.width or pfUI.uf.target:GetWidth()
pfUI.castbar.target:SetPoint("TOPLEFT", pfUI.uf.target, "BOTTOMLEFT", 0, -pfUI.castbar.target.spacing)
local anchor = pfUI.uf.target.portrait:GetHeight() > pfUI.uf.target:GetHeight() and pfUI.uf.target.power or pfUI.uf.target
local width = C.castbar.target.width ~= "-1" and C.castbar.target.width or anchor:GetWidth()
pfUI.castbar.target:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", 0, -pfUI.castbar.target.spacing)
pfUI.castbar.target:SetWidth(width)
else
local width = C.castbar.target.width ~= "-1" and C.castbar.target.width or 200
@@ -271,8 +273,9 @@ pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
pfUI.castbar.focus.unitstr = nil
end
local width = C.castbar.focus.width ~= "-1" and C.castbar.focus.width or pfUI.uf.focus:GetWidth()
pfUI.castbar.focus:SetPoint("TOPLEFT", pfUI.uf.focus, "BOTTOMLEFT", 0, -pfUI.castbar.focus.spacing)
local anchor = pfUI.uf.focus.portrait:GetHeight() > pfUI.uf.focus:GetHeight() and pfUI.uf.focus.power or pfUI.uf.focus
local width = C.castbar.focus.width ~= "-1" and C.castbar.focus.width or anchor:GetWidth()
pfUI.castbar.focus:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", 0, -pfUI.castbar.focus.spacing)
pfUI.castbar.focus:SetWidth(width)
if C.castbar.focus.height ~= "-1" then