From 01c7d68db9784e96d120e1c03c3a5a82fd2cd00b Mon Sep 17 00:00:00 2001 From: shagu Date: Thu, 24 Jul 2025 09:30:44 +0200 Subject: [PATCH] castbar: dodge oversized unitframe portraits --- modules/castbar.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/castbar.lua b/modules/castbar.lua index d8ef773b..81496ef8 100644 --- a/modules/castbar.lua +++ b/modules/castbar.lua @@ -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