feat(animate): add done to animation object

This commit is contained in:
Folke Lemaitre 2024-12-13 08:08:42 +01:00
parent 370703da81
commit ec73346b7d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -60,6 +60,7 @@ local scheduled = false
---@field opts snacks.animate.Opts
---@field from number start value
---@field to number end value
---@field done boolean
---@field duration number total duration in ms
---@field easing snacks.animate.easing.Fn
---@field value number current value
@ -93,6 +94,7 @@ function Animation:update()
if prev ~= value or done then
self.cb(value, { anim = self, prev = prev, done = done })
self.value = value
self.done = done
end
return done
end