From fa3f191eeaea763a62acbd5a9001210cbca93aa8 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Mon, 22 Jun 2026 10:11:33 -0500 Subject: [PATCH] castbar: pixel-snap progress via PixelUtil.SetStatusBarValue Routes player and nameplate castbar progress through PixelUtil.SetStatusBarValue so a 1.4s cast on a narrow bar no longer shimmers across fractional pixels as it ticks. Adds GetMinMaxValues / GetValue handlers to pfUI's custom StatusBar so PixelUtil can read the current range. --- api/ui-widgets.lua | 8 ++++++++ modules/castbar.lua | 2 +- modules/nameplates.lua | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/api/ui-widgets.lua b/api/ui-widgets.lua index 4d695613..9c7258cb 100644 --- a/api/ui-widgets.lua +++ b/api/ui-widgets.lua @@ -83,6 +83,14 @@ do -- statusbars self:DisplayValue(self.val_ or self.val) end, + ["GetMinMaxValues"] = function(self) + return self.min, self.max + end, + + ["GetValue"] = function(self) + return self.val + end, + ["SetValue"] = function(self, val) self.val = val or 0 diff --git a/modules/castbar.lua b/modules/castbar.lua index c01509bb..020d1586 100644 --- a/modules/castbar.lua +++ b/modules/castbar.lua @@ -237,7 +237,7 @@ pfUI:RegisterModule("castbar", function () cur = cur > max and max or cur cur = cur < 0 and 0 or cur - this.bar:SetValue(cur) + PixelUtil.SetStatusBarValue(this.bar, cur) if this.showtimer then if this.delay and this.delay > 0 then diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 50d9bd5f..cc537f2d 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -1752,7 +1752,7 @@ end end barValue = barValue < 0 and 0 or barValue barValue = barValue > duration and duration or barValue - nameplate.castbar:SetValue(barValue) + PixelUtil.SetStatusBarValue(nameplate.castbar, barValue) SetCastbarText(nameplate.castbar, castInfo.endTime - now) if not nameplate.castbar.isShown then nameplate.castbar.isShown = true; nameplate.castbar:Show() end end @@ -1787,7 +1787,7 @@ end nameplate.castbar.spell:SetText("") end end - nameplate.castbar:SetValue(cur) + PixelUtil.SetStatusBarValue(nameplate.castbar, cur) SetCastbarText(nameplate.castbar, channel and cur or (max - cur)) if not nameplate.castbar.isShown then nameplate.castbar.isShown = true; nameplate.castbar:Show() end else