Animate Refactor and Fixes
This release improves timestep's animate
by adding functionality and fixing small behavior differences between animate in the browser and the accelerated animate implementation in native. It also includes changes from v3.0.0-rc1
tag. See release notes from v3.0.0-rc1 for the rest of the updates.
Major changes
- The
Animator
class returned by theanimate
API is now created once persubject
andgroupID
pair. - Animators are now cached on the subject, in an
__anims
object, so that they only get garbage collected when the subject is garbage collected - The
Group
class returned by theanimate.getGroup
API has new functionalitypause
,resume
,clear
, andcommit
functions now exist on groups of animators
- Also exposed subject-specific and global functions for
pause
,resume
,clear
, andcommit
animate.pauseAllAnimations
animate.resumeAllAnimations
animate.clearAllAnimations
animate.commitAllAnimations
animate.pauseSubjectAnimations
animate.resumeSubjectAnimations
animate.clearSubjectAnimations
animate.commitSubjectAnimations
- Fixed a bug with
commit
that allowed multiple instance ofAnimator
to fight for precedence, on native builds only - Fixed a bug with
then
that wasn't properly settingelapsed
to 0 on native builds only; the behavior now matches the browser JavaScript - Fixed a bug where instances of
Animator
only inheritedEmitter
(PubSub
) functionality in browser; they now always also work as event emitters in native commit
now also callsresume
on paused animations so that they finish instantly
Breaking changes
- The
Group
class returned byanimate.getGroup
no longer has aget
function; it was redundant, since it returned the same thing asanimate(subject, groupID)
- Group's
add
function behavior changed, and should still be used primarily internally by theAnimator
class