Skip to content
Permalink
Browse files

Pull animatable into a seperate function

  • Loading branch information
nvh committed Sep 15, 2016
1 parent 4864241 commit e9a76d2fbc509562f0d9953803ad1d9166574beb
Showing with 4 additions and 1 deletion.
  1. +4 −1 framer/Animation.coffee
@@ -296,13 +296,16 @@ class exports.Animation extends BaseClass
value = parseFloat parsedCurve.args[i]
@options.curveOptions[k] = value if value

@isAnimatable = (v) ->
_.isNumber(v) or _.isFunction(v) or isRelativeProperty(v) or Color.isColorObject(v) or v == null

@filterAnimatableProperties = (properties) ->
# Function to filter only animatable properties out of a given set
animatableProperties = {}

# Only animate numeric properties for now
for k, v of properties
if _.isNumber(v) or _.isFunction(v) or isRelativeProperty(v) or Color.isColorObject(v) or v == null
if @isAnimatable(v)
animatableProperties[k] = v
else if Color.isValidColorProperty(k,v)
animatableProperties[k] = new Color(v)

0 comments on commit e9a76d2

Please sign in to comment.
You can’t perform that action at this time.