mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-06 19:58:22 +00:00
feat(animate): add done to animation object
This commit is contained in:
parent
370703da81
commit
ec73346b7d
1 changed files with 2 additions and 0 deletions
|
@ -60,6 +60,7 @@ local scheduled = false
|
||||||
---@field opts snacks.animate.Opts
|
---@field opts snacks.animate.Opts
|
||||||
---@field from number start value
|
---@field from number start value
|
||||||
---@field to number end value
|
---@field to number end value
|
||||||
|
---@field done boolean
|
||||||
---@field duration number total duration in ms
|
---@field duration number total duration in ms
|
||||||
---@field easing snacks.animate.easing.Fn
|
---@field easing snacks.animate.easing.Fn
|
||||||
---@field value number current value
|
---@field value number current value
|
||||||
|
@ -93,6 +94,7 @@ function Animation:update()
|
||||||
if prev ~= value or done then
|
if prev ~= value or done then
|
||||||
self.cb(value, { anim = self, prev = prev, done = done })
|
self.cb(value, { anim = self, prev = prev, done = done })
|
||||||
self.value = value
|
self.value = value
|
||||||
|
self.done = done
|
||||||
end
|
end
|
||||||
return done
|
return done
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue