I was having an issue with the default blizzard castbar and several castbar-like addons where their animation would appear choppy whenever my system uptime got too high (say I hadn't restarted my PC in a couple weeks, because I just put it to sleep instead). oCB, Abar, and NECB in particular.
I found a solution by looking at what the creator of CBRipoff did to fix the problem in an old wowace forum
post. The fix is to instead call SetMinMaxValues with constant values (1,100), and SetValue with the percentage of n or b through the cast time e.g.
- Code: Select all
oCB.frames.CastingBar.Bar:SetValue(n)
becomes
- Code: Select all
local np = ((n - oCB.startTime) / (oCB.maxValue - oCB.startTime)) * 100
oCB.frames.CastingBar.Bar:SetValue(np)
I applied this to the latest casting.lua from the master branch and everything is smooth again, I hope it's useful to your project.
http://pastebin.com/j3LmqUj9