Permalink
Browse files

Fix error when animating borderWidth or borderRadius to undefined

  • Loading branch information...
nvh committed Oct 2, 2017
1 parent 2a91ec1 commit e5c07238da10c95b262c2776ec8f539a133b54a6
Showing with 13 additions and 2 deletions.
  1. +2 −2 framer/Animation.coffee
  2. +11 −0 test/tests/LayerAnimationTest.coffee
View
@@ -307,8 +307,8 @@ class exports.Animation extends BaseClass
result = {}
for propKey in propKeys
keyValueA = if _.isNumber(valueA) then valueA else valueA[propKey]
keyValueB = if _.isNumber(valueB) then valueB else valueB[propKey]
keyValueA = if _.isNumber(valueA) then valueA else valueA?[propKey]
keyValueB = if _.isNumber(valueB) then valueB else valueB?[propKey]
# If the key value is undefined in one state, use the value from the other
keyValueA ?= keyValueB
keyValueB ?= keyValueA
@@ -1188,6 +1188,17 @@ describe "LayerAnimation", ->
layer.animate
borderWidth: 10
it "should not touch border width when animating from object to undefined", (done) ->
layer = new Layer
borderWidth:
top: 30
layer.on Events.AnimationEnd, ->
layer.borderWidth.should.eql {left: 0, right: 0, bottom: 0, top: 30}
done()
layer.animate
x: 10
borderWidth: undefined
describe "template animations", ->
it "should animate", (done) ->

0 comments on commit e5c0723

Please sign in to comment.