From 9752a012fbe06397d9c6abd68e80aedbb8f29247 Mon Sep 17 00:00:00 2001 From: shagu Date: Mon, 21 Jul 2025 09:00:06 +0200 Subject: [PATCH] unitframes: use same anchor for custom sized portraits --- api/unitframes.lua | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 2c6f2416..d0c1ba41 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -414,6 +414,7 @@ function pfUI.uf:UpdateFrameSize() -- use custom portrait size self.portrait:SetWidth(ptwidth) self.portrait:SetHeight(ptheight) + portrait = ptwidth + spacing + 2*default_border end end @@ -534,11 +535,7 @@ function pfUI.uf:UpdateConfig() elseif f.config.portrait == "left" then f.portrait:SetParent(f) f.portrait:ClearAllPoints() - if f.config.portraitwidth == "-1" and f.config.portraitheight == "-1" then - f.portrait:SetPoint("TOPLEFT", f, "TOPLEFT", 0, 0) - else - f.portrait:SetPoint("LEFT", f, "LEFT", -f.config.portraitwidth - 2*default_border - spacing, 0) - end + f.portrait:SetPoint("LEFT", f, "LEFT", 0, 0) f.hp:ClearAllPoints() f.hp:SetPoint("TOPRIGHT", f, "TOPRIGHT", 0, 0) @@ -556,11 +553,7 @@ function pfUI.uf:UpdateConfig() elseif f.config.portrait == "right" then f.portrait:SetParent(f) f.portrait:ClearAllPoints() - if f.config.portraitwidth == "-1" and f.config.portraitheight == "-1" then - f.portrait:SetPoint("TOPRIGHT", f, "TOPRIGHT", 0, 0) - else - f.portrait:SetPoint("RIGHT", f, "RIGHT", f.config.portraitwidth + 2*default_border + spacing, 0) - end + f.portrait:SetPoint("RIGHT", f, "RIGHT", 0, 0) f.hp:ClearAllPoints() f.hp:SetPoint("TOPLEFT", f, "TOPLEFT", 0, 0)