Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add path as a derived animation property
  • Loading branch information
nvh committed Feb 1, 2018
1 parent 08c3304 commit e249eb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion framer/Animation.coffee
Expand Up @@ -430,14 +430,17 @@ class exports.Animation extends BaseClass


# Only animate numeric properties for now # Only animate numeric properties for now
for k, v of properties for k, v of properties
if k in ["frame", "size", "point", "midPoint"] # Derived properties if k in ["frame", "size", "point", "midPoint", "path"] # Derived properties
switch k switch k
when "frame" then derivedKeys = ["x", "y", "width", "height"] when "frame" then derivedKeys = ["x", "y", "width", "height"]
when "size" then derivedKeys = ["width", "height"] when "size" then derivedKeys = ["width", "height"]
when "point" then derivedKeys = ["x", "y"] when "point" then derivedKeys = ["x", "y"]
when "midPoint" then derivedKeys = ["midX", "midY"] when "midPoint" then derivedKeys = ["midX", "midY"]
when "path" then derivedKeys = ["x", "y", "rotation"]
else derivedKeys = [] else derivedKeys = []
if SVG.isPath(v) if SVG.isPath(v)
if k is "path"
layer.midPoint = v.start
for derivedKey in derivedKeys for derivedKey in derivedKeys
animatableProperties[derivedKey] = v animatableProperties[derivedKey] = v
else if _.isObject(v) else if _.isObject(v)
Expand Down

0 comments on commit e249eb0

Please sign in to comment.