diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-30 13:19:58 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-30 13:19:58 +0100 |
commit | f4531868a190af69c4ecdcf6d7be6d3fc59f5d46 (patch) | |
tree | 1fc76780ad6918ef7b6eb0e302a55f1b043d8bc5 /src/animation/Animator.js | |
parent | d64b964d21e1399b198e44555be68a12378053e7 (diff) | |
parent | efc82b0eafa72902b35c2b22cd9e86bdbdd3edfb (diff) | |
download | svg.js-f4531868a190af69c4ecdcf6d7be6d3fc59f5d46.tar.gz svg.js-f4531868a190af69c4ecdcf6d7be6d3fc59f5d46.zip |
Merge branch '3.0.0' into 790-color-spaces
Diffstat (limited to 'src/animation/Animator.js')
-rw-r--r-- | src/animation/Animator.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/animation/Animator.js b/src/animation/Animator.js index cac0eb9..2786602 100644 --- a/src/animation/Animator.js +++ b/src/animation/Animator.js @@ -5,7 +5,7 @@ const Animator = { nextDraw: null, frames: new Queue(), timeouts: new Queue(), - timer: globals.window.performance || globals.window.Date, + timer: () => globals.window.performance || globals.window.Date, transforms: [], frame (fn) { @@ -29,7 +29,7 @@ const Animator = { delay = delay || 0 // Work out when the event should fire - var time = Animator.timer.now() + delay + var time = Animator.timer().now() + delay // Add the timeout to the end of the queue var node = Animator.timeouts.push({ run: fn, time: time }) @@ -43,11 +43,11 @@ const Animator = { }, cancelFrame (node) { - Animator.frames.remove(node) + node != null && Animator.frames.remove(node) }, clearTimeout (node) { - Animator.timeouts.remove(node) + node != null && Animator.timeouts.remove(node) }, _draw (now) { |