Skip to content

Commit

Permalink
Move creation of animator to seperate function
Browse files Browse the repository at this point in the history
  • Loading branch information
nvh committed Sep 15, 2016
1 parent f8e4c6b commit afbff06
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions framer/Animation.coffee
Expand Up @@ -69,13 +69,7 @@ class exports.Animation extends BaseClass
if @layer is null
console.error "Animation: missing layer"

AnimatorClass = @_animatorClass()

if @options.debug
console.log "Animation.start #{AnimatorClass.name}", @options.curveOptions

@_animator = new AnimatorClass @options.curveOptions

@_animator = @_createAnimator()
@_target = @layer
@_stateA = @_currentState()
@_stateB = {}
Expand Down Expand Up @@ -236,6 +230,14 @@ class exports.Animation extends BaseClass
_currentState: ->
return _.pick(@layer, _.keys(@properties))

_createAnimator: ->
AnimatorClass = @_animatorClass()

if @options.debug
console.log "Animation.start #{AnimatorClass.name}", @options.curveOptions

return new AnimatorClass @options.curveOptions

_animatorClass: ->

parsedCurve = Utils.parseFunction(@options.curve)
Expand Down

0 comments on commit afbff06

Please sign in to comment.