From dd4ebda0a98f187b28b658271c600e237a337ca5 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Mon, 2 Nov 2026 19:44:42 -0600 Subject: [PATCH] Unit frames: anchor the heal prediction to the health fill's edge ClassicAPI v1.19.1 moves a status bar texture's rect with the fill, so the prediction starts at GetStatusBarTexture() and is only as wide as the incoming heal. It follows the health bar while it animates instead of sitting at the final value. --- api/unitframes.lua | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index be7f7548..ea80b0d9 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -853,12 +853,16 @@ function pfUI.uf:UpdateConfig() f.incHeal.texture:SetVertexColor(cr, cg, cb, ca) f.incHeal:Hide() - if f.config.verticalbar == "0" then - f.incHeal:ClearAllPoints() - f.incHeal:SetPoint("TOPLEFT", f.hp.bar, "TOPLEFT", 0, 0) + -- the bar texture covers only the fill, so a prediction anchored to it + -- starts at the edge of the health and follows it as the bar animates. + -- An inverted bar fills with the missing health, so it starts at the bar. + f.incHeal:ClearAllPoints() + if f.config.invert_healthbar == "1" then + f.incHeal:SetPoint(f.config.verticalbar == "0" and "TOPLEFT" or "BOTTOM", f.hp.bar) + elseif f.config.verticalbar == "0" then + f.incHeal:SetPoint("TOPLEFT", f.hp.bar:GetStatusBarTexture(), "TOPRIGHT") else - f.incHeal:ClearAllPoints() - f.incHeal:SetPoint("BOTTOM", f.hp.bar, "BOTTOM", 0, 0) + f.incHeal:SetPoint("BOTTOMLEFT", f.hp.bar:GetStatusBarTexture(), "TOPLEFT") end f.ressIcon:SetFrameLevel(16) @@ -1259,24 +1263,14 @@ function pfUI.uf.OnUpdate() if healthWidth + incWidth > width * (1+(overhealperc/100)) then incWidth = width * (1+overhealperc/100) - healthWidth end - - if this.config.invert_healthbar == "1" then - this.incHeal:SetWidth(incWidth) - else - this.incHeal:SetWidth(incWidth + healthWidth) - end + this.incHeal:SetWidth(incWidth) else local healthHeight = height * (health / maxHealth) local incHeight = height * heal / maxHealth if healthHeight + incHeight > height * (1+(overhealperc/100)) then incHeight = height * (1+overhealperc/100) - healthHeight end - - if this.config.invert_healthbar == "1" then - this.incHeal:SetHeight(incHeight) - else - this.incHeal:SetHeight(incHeight + healthHeight) - end + this.incHeal:SetHeight(incHeight) end this.incHeal:Show()