Permalink
Browse files

Fixed animation of frame, size and point properties

  • Loading branch information...
nvh committed Nov 23, 2016
1 parent 50b9e61 commit b6fbac8b526819151c87e8c4e227e07678c1c3ba
Showing with 16 additions and 0 deletions.
  1. +2 −0 framer/Animation.coffee
  2. +14 −0 test/tests/LayerAnimationTest.coffee
View
@@ -306,6 +306,8 @@ class exports.Animation extends BaseClass
animatableProperties[k] = v
else if Color.isValidColorProperty(k, v)
animatableProperties[k] = new Color(v)
+ else if k in ["frame", "size", "point"] # Derived properties
+ _.defaults(animatableProperties, v)
return animatableProperties
@@ -252,6 +252,20 @@ describe "LayerAnimation", ->
delay: 1
animation.finish.should.not.throw()
+ it "should work with derived properties like size", (done) ->
+ layer = new Layer
+ animation = layer.animate
+ x: 300
+ size:
+ width: 400
+ height: 500
+
+ animation.onAnimationEnd ->
+ layer.x.should.equal 300
+ layer.width.should.equal 400
+ layer.height.should.equal 500
+ done()
+
describe "Context", ->
it "should list running animations", ->

0 comments on commit b6fbac8

Please sign in to comment.