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.
This commit is contained in:
Brues
2026-11-03 01:07:02 -06:00
parent 1abeafcec2
commit dd4ebda0a9
+11 -17
View File
@@ -853,12 +853,16 @@ function pfUI.uf:UpdateConfig()
f.incHeal.texture:SetVertexColor(cr, cg, cb, ca) f.incHeal.texture:SetVertexColor(cr, cg, cb, ca)
f.incHeal:Hide() f.incHeal:Hide()
if f.config.verticalbar == "0" then -- the bar texture covers only the fill, so a prediction anchored to it
f.incHeal:ClearAllPoints() -- starts at the edge of the health and follows it as the bar animates.
f.incHeal:SetPoint("TOPLEFT", f.hp.bar, "TOPLEFT", 0, 0) -- 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 else
f.incHeal:ClearAllPoints() f.incHeal:SetPoint("BOTTOMLEFT", f.hp.bar:GetStatusBarTexture(), "TOPLEFT")
f.incHeal:SetPoint("BOTTOM", f.hp.bar, "BOTTOM", 0, 0)
end end
f.ressIcon:SetFrameLevel(16) f.ressIcon:SetFrameLevel(16)
@@ -1259,24 +1263,14 @@ function pfUI.uf.OnUpdate()
if healthWidth + incWidth > width * (1+(overhealperc/100)) then if healthWidth + incWidth > width * (1+(overhealperc/100)) then
incWidth = width * (1+overhealperc/100) - healthWidth incWidth = width * (1+overhealperc/100) - healthWidth
end end
this.incHeal:SetWidth(incWidth)
if this.config.invert_healthbar == "1" then
this.incHeal:SetWidth(incWidth)
else
this.incHeal:SetWidth(incWidth + healthWidth)
end
else else
local healthHeight = height * (health / maxHealth) local healthHeight = height * (health / maxHealth)
local incHeight = height * heal / maxHealth local incHeight = height * heal / maxHealth
if healthHeight + incHeight > height * (1+(overhealperc/100)) then if healthHeight + incHeight > height * (1+(overhealperc/100)) then
incHeight = height * (1+overhealperc/100) - healthHeight incHeight = height * (1+overhealperc/100) - healthHeight
end end
this.incHeal:SetHeight(incHeight)
if this.config.invert_healthbar == "1" then
this.incHeal:SetHeight(incHeight)
else
this.incHeal:SetHeight(incHeight + healthHeight)
end
end end
this.incHeal:Show() this.incHeal:Show()