From d7c4bb051f306ad806100219781093e429a6bc70 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Thu, 9 Nov 2023 20:51:50 +0700 Subject: [PATCH] healthprediction: Fix unwanted statusbar behaviour (#664) --- elements/healthprediction.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/elements/healthprediction.lua b/elements/healthprediction.lua index 19e61c428..a6d1f1f63 100644 --- a/elements/healthprediction.lua +++ b/elements/healthprediction.lua @@ -138,25 +138,29 @@ local function Update(self, event, unit) end if(element.myBar) then - element.myBar:SetMinMaxValues(0, maxHealth) + -- BUG: As of 10.2, when the current value matches the min value the status bar texture + -- despite not being visible is actually set to the max which is the opposite of what we + -- want, and it breaks all the anchors on top of that. Setting the min value slightly below + -- 0 allows us to imitate the original pre-10.2 behaviour. + element.myBar:SetMinMaxValues(-0.001, maxHealth) element.myBar:SetValue(myIncomingHeal) element.myBar:Show() end if(element.otherBar) then - element.otherBar:SetMinMaxValues(0, maxHealth) + element.otherBar:SetMinMaxValues(-0.001, maxHealth) element.otherBar:SetValue(otherIncomingHeal) element.otherBar:Show() end if(element.absorbBar) then - element.absorbBar:SetMinMaxValues(0, maxHealth) + element.absorbBar:SetMinMaxValues(-0.001, maxHealth) element.absorbBar:SetValue(absorb) element.absorbBar:Show() end if(element.healAbsorbBar) then - element.healAbsorbBar:SetMinMaxValues(0, maxHealth) + element.healAbsorbBar:SetMinMaxValues(-0.001, maxHealth) element.healAbsorbBar:SetValue(healAbsorb) element.healAbsorbBar:Show() end