From 7613d337a7fb50f23ba23a2ef2072c799166cb9c Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 24 Oct 2021 14:32:05 +0200 Subject: [PATCH] unitframes: align spacing of custom sized portrait --- api/unitframes.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 4ef6fa82..8b5d2301 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -361,6 +361,7 @@ function pfUI.uf:UpdateConfig() local f = self local C = pfUI_config local rawborder, default_border = GetBorderSize("unitframes") + local spacing = f.config.pspace * GetPerfectPixel() local cooldown_text = tonumber(f.config.cooldown_text) local cooldown_anim = tonumber(f.config.cooldown_anim) @@ -477,7 +478,7 @@ function pfUI.uf:UpdateConfig() 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, 0) + f.portrait:SetPoint("LEFT", f, "LEFT", -f.config.portraitwidth - 2*default_border - spacing, 0) end f.hp:ClearAllPoints() @@ -499,7 +500,7 @@ function pfUI.uf:UpdateConfig() 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, 0) + f.portrait:SetPoint("RIGHT", f, "RIGHT", f.config.portraitwidth + 2*default_border + spacing, 0) end f.hp:ClearAllPoints()