From 459ce027fa8e22ce24e2ef5ed8ed13079ca73b2f Mon Sep 17 00:00:00 2001 From: Krathe Date: Fri, 15 May 2026 22:48:42 +0100 Subject: [PATCH 1/3] Fix dispel overlay gradient snapping to full brightness after OOR transition UpdateDispelOverlayAppearance was restoring the gradient to alpha 1.0 when a unit came back in range, ignoring the configured dispelGradientAlpha. This was masked before PR #65 because ShowOverlayWithSecretColor also used 1.0, but after #65 corrected that function to use the configured alpha the two fell out of sync. The dfLastDispelAuraID skip then prevented ShowOverlay from correcting it, leaving the gradient stuck at full brightness permanently. Fix: use element-specific alphas (gradientAlpha, borderAlpha, iconAlpha) derived from settings in UpdateDispelOverlayAppearance, matching what ShowOverlayWithSecretColor applies, so OOR->in-range transitions restore the correct opacity rather than 1.0. --- CHANGELOG.md | 1 + Features/ElementAppearance.lua | 40 +++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a332cd3..8457a4f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Bug Fixes +* (Dispel Overlay) Fix gradient snapping to full brightness after a unit goes out of range and back in range while they have a dispellable debuff. (PR #88 by Krathe) * (Aura Designer) Banner controls no longer overlap when the settings window is narrow. (PR #81 by Krathe) * (Class Power) Fix Size, Colors, Position, and Show for Roles section headers showing as floating labels when Class Power Pips is disabled. (PR #82 by Krathe) * (Defensive Icons) Fix icon borders missing on one or more sides when Pixel Perfect is enabled. (PR #79 by Krathe) diff --git a/Features/ElementAppearance.lua b/Features/ElementAppearance.lua index 72939f61..44e4b7a8 100644 --- a/Features/ElementAppearance.lua +++ b/Features/ElementAppearance.lua @@ -798,35 +798,45 @@ function DF:UpdateDispelOverlayAppearance(frame) local deadOrOffline = IsDeadOrOffline(frame) local inRange = GetInRange(frame) local overlay = frame.dfDispelOverlay - local alpha = 1.0 + + -- Dead/offline fade multiplier (1.0 when alive) + local deadAlpha = 1.0 if deadOrOffline and db.fadeDeadFrames then - alpha = db.fadeDeadBackground or 1 + deadAlpha = db.fadeDeadBackground or 1 end - + + -- Element-specific base alphas, matching what ShowOverlayWithSecretColor sets. + -- Using 1.0 here (as before PR #65) caused the gradient to snap back to full + -- opacity after OOR->in-range transitions, because UpdateDispelOverlayAppearance + -- overwrote the configured alpha that ShowOverlayWithSecretColor had applied. + local gradAlpha = math.min((db.dispelGradientAlpha or 0.5) * (db.dispelGradientIntensity or 1.0), 1.0) * deadAlpha + local brdAlpha = (db.dispelBorderAlpha or 0.8) * deadAlpha + local icnAlpha = (db.dispelIconAlpha or 1.0) * deadAlpha + if db.oorEnabled then local oorAlpha = db.oorDispelOverlayAlpha or 0.2 - ApplyOORAlpha(overlay.gradient, inRange, alpha, oorAlpha) - ApplyOORAlpha(overlay.borderTop, inRange, alpha, oorAlpha) - ApplyOORAlpha(overlay.borderBottom, inRange, alpha, oorAlpha) - ApplyOORAlpha(overlay.borderLeft, inRange, alpha, oorAlpha) - ApplyOORAlpha(overlay.borderRight, inRange, alpha, oorAlpha) + ApplyOORAlpha(overlay.gradient, inRange, gradAlpha, gradAlpha * oorAlpha) + ApplyOORAlpha(overlay.borderTop, inRange, brdAlpha, brdAlpha * oorAlpha) + ApplyOORAlpha(overlay.borderBottom, inRange, brdAlpha, brdAlpha * oorAlpha) + ApplyOORAlpha(overlay.borderLeft, inRange, brdAlpha, brdAlpha * oorAlpha) + ApplyOORAlpha(overlay.borderRight, inRange, brdAlpha, brdAlpha * oorAlpha) if overlay.icons then for _, icon in pairs(overlay.icons) do - ApplyOORAlpha(icon, inRange, alpha, oorAlpha) + ApplyOORAlpha(icon, inRange, icnAlpha, icnAlpha * oorAlpha) end end if DF.ApplyDispelOverlayAppearance then DF:ApplyDispelOverlayAppearance(frame) end else - if overlay.gradient then overlay.gradient:SetAlpha(alpha) end - if overlay.borderTop then overlay.borderTop:SetAlpha(alpha) end - if overlay.borderBottom then overlay.borderBottom:SetAlpha(alpha) end - if overlay.borderLeft then overlay.borderLeft:SetAlpha(alpha) end - if overlay.borderRight then overlay.borderRight:SetAlpha(alpha) end + if overlay.gradient then overlay.gradient:SetAlpha(gradAlpha) end + if overlay.borderTop then overlay.borderTop:SetAlpha(brdAlpha) end + if overlay.borderBottom then overlay.borderBottom:SetAlpha(brdAlpha) end + if overlay.borderLeft then overlay.borderLeft:SetAlpha(brdAlpha) end + if overlay.borderRight then overlay.borderRight:SetAlpha(brdAlpha) end if overlay.icons then for _, icon in pairs(overlay.icons) do - icon:SetAlpha(alpha) + icon:SetAlpha(icnAlpha) end end end From dcd26a6762b9fd5557f9e4fe920619961820c13c Mon Sep 17 00:00:00 2001 From: Krathe Date: Fri, 15 May 2026 22:57:06 +0100 Subject: [PATCH 2/3] Fix PR number in changelog entry (#88 -> #89) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8457a4f0..188497f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ ### Bug Fixes -* (Dispel Overlay) Fix gradient snapping to full brightness after a unit goes out of range and back in range while they have a dispellable debuff. (PR #88 by Krathe) +* (Dispel Overlay) Fix gradient snapping to full brightness after a unit goes out of range and back in range while they have a dispellable debuff. (PR #89 by Krathe) * (Aura Designer) Banner controls no longer overlap when the settings window is narrow. (PR #81 by Krathe) * (Class Power) Fix Size, Colors, Position, and Show for Roles section headers showing as floating labels when Class Power Pips is disabled. (PR #82 by Krathe) * (Defensive Icons) Fix icon borders missing on one or more sides when Pixel Perfect is enabled. (PR #79 by Krathe) From 190b72fc0ffeb032fba73b9506287dc255789422 Mon Sep 17 00:00:00 2001 From: Krathe Date: Sat, 16 May 2026 17:01:52 +0100 Subject: [PATCH 3/3] Revert border/icon alpha to 1.0 to match ShowOverlayWithSecretColor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ShowOverlayWithSecretColor hardcodes 1.0 for all border and icon textures. Reading dispelBorderAlpha/dispelIconAlpha in UpdateDispelOverlayAppearance caused ~5Hz flicker for users with non-default values (UNIT_AURA sets 1.0, range ticker dims them back). Gradient alpha correctly reads the configured value — that was the actual bug. Border/icon alignment with user settings is a follow-up. --- Features/ElementAppearance.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Features/ElementAppearance.lua b/Features/ElementAppearance.lua index 44e4b7a8..c4cb3256 100644 --- a/Features/ElementAppearance.lua +++ b/Features/ElementAppearance.lua @@ -805,13 +805,17 @@ function DF:UpdateDispelOverlayAppearance(frame) deadAlpha = db.fadeDeadBackground or 1 end - -- Element-specific base alphas, matching what ShowOverlayWithSecretColor sets. - -- Using 1.0 here (as before PR #65) caused the gradient to snap back to full - -- opacity after OOR->in-range transitions, because UpdateDispelOverlayAppearance - -- overwrote the configured alpha that ShowOverlayWithSecretColor had applied. + -- Gradient alpha reads the configured value — this was the bug: using 1.0 here + -- caused the gradient to snap back to full brightness after OOR->in-range + -- transitions because UpdateDispelOverlayAppearance overwrote the value that + -- ShowOverlayWithSecretColor had applied. + -- Borders and icons stay at 1.0 to match what ShowOverlayWithSecretColor + -- hardcodes. Until that function is updated to read the user settings, using + -- db.dispelBorderAlpha/db.dispelIconAlpha here would cause ~5Hz flicker + -- (ShowOverlayWithSecretColor sets 1.0, range ticker dims them back). local gradAlpha = math.min((db.dispelGradientAlpha or 0.5) * (db.dispelGradientIntensity or 1.0), 1.0) * deadAlpha - local brdAlpha = (db.dispelBorderAlpha or 0.8) * deadAlpha - local icnAlpha = (db.dispelIconAlpha or 1.0) * deadAlpha + local brdAlpha = 1.0 * deadAlpha + local icnAlpha = 1.0 * deadAlpha if db.oorEnabled then local oorAlpha = db.oorDispelOverlayAlpha or 0.2