Permalink
Browse files

Fix unintended border radius animation.

  • Loading branch information...
eelco committed Jul 6, 2017
1 parent e1e8316 commit 5317cbc0182514972b8185a74f8c781aad922b39
Showing with 15 additions and 1 deletion.
  1. +4 −1 framer/Animation.coffee
  2. +11 −0 test/tests/LayerAnimationTest.coffee
View
@@ -116,6 +116,9 @@ class exports.Animation extends BaseClass
for k, v of @properties
# Filter out properties that are literally equal
continue if @_stateA[k] is v
# Evaluate function properties
if _.isFunction(v)
v = v(@layer, k)
@@ -124,7 +127,7 @@ class exports.Animation extends BaseClass
else if isRelativeProperty(v)
v = evaluateRelativeProperty(@_target, k, v)
# Filter out the properties that are equal
# Filter out the properties that have equal values
@_stateB[k] = v if @_stateA[k] isnt v
if _.keys(@_stateA).length is 0
@@ -955,6 +955,17 @@ describe "LayerAnimation", ->
layer.animate
borderRadius: 20
it "should not touch border radius if its a string", (done) ->
layer = new Layer
borderRadius: "100%"
layer.states.test =
scale: 1.5
layer.stateSwitch "test"
layer.on Events.AnimationEnd, ->
layer.borderRadius.should.equal "100%"
done()
layer.stateCycle()
describe "Border width animations", (done) ->
it "should animate border width from number to number", (done) ->

0 comments on commit 5317cbc

Please sign in to comment.