Permalink
Browse files

Fix animation rounding issue

  • Loading branch information...
koenbok committed Oct 5, 2014
1 parent 2a0439a commit fbde7a86c23aef892d53fa8ff083411a63086d37
Showing with 6 additions and 2 deletions.
  1. +4 −1 framer/Animators/BezierCurveAnimator.coffee
  2. +2 −1 framer/Animators/LinearAnimator.coffee
@@ -29,6 +29,9 @@ class exports.BezierCurveAnimator extends Animator
@options = Utils.setDefaultProperties options,
values: BezierCurveDefaults["ease-in-out"]
time: 1
precision: 1/1000
console.log "values", @options.values
@_unitBezier = new UnitBezier \
@options.values[0],
@@ -49,7 +52,7 @@ class exports.BezierCurveAnimator extends Animator
@_unitBezier.solve @_time / @options.time
finished: ->
@_time >= @options.time
@_time >= @options.time - @options.precision
# WebKit implementation found on http://stackoverflow.com/a/11697909
@@ -8,6 +8,7 @@ class exports.LinearAnimator extends Animator
@options = Utils.setDefaultProperties options,
time: 1
precision: 1/1000
@_time = 0
@@ -20,4 +21,4 @@ class exports.LinearAnimator extends Animator
@_time / @options.time
finished: ->
@_time >= @options.time
@_time >= @options.time - @options.precision

0 comments on commit fbde7a8

Please sign in to comment.