mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-06 03:38:16 +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 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue