diff --git a/framer/Animation.coffee b/framer/Animation.coffee index 34ce2689a..672885a43 100644 --- a/framer/Animation.coffee +++ b/framer/Animation.coffee @@ -317,6 +317,7 @@ class exports.Animation extends BaseClass # This is for compatibility with the direct Animation.time argument. This should # ideally also be passed as a curveOption + @options.curveOptions ?= {} if animatorClass in [LinearAnimator, BezierCurveAnimator] if _.isString(@options.curveOptions) or _.isArray(@options.curveOptions) @options.curveOptions = diff --git a/test/tests/LayerAnimationTest.coffee b/test/tests/LayerAnimationTest.coffee index 30580516f..4792bd557 100644 --- a/test/tests/LayerAnimationTest.coffee +++ b/test/tests/LayerAnimationTest.coffee @@ -661,6 +661,20 @@ describe "LayerAnimation", -> layer.x.should.equal 10 done() + it "should support properties with options that have undefined curveOptions as object", (done) -> + layer = new Layer + layer.animationOptions = time: AnimationTime + animation = layer.animate + x: 10 + options: + curve: "linear" + curveOptions: undefined + + animation.options.curve.should.equal "linear" + animation.on Events.AnimationEnd, -> + layer.x.should.equal 10 + done() + it "should support states", (done) -> layer = new Layer layer.animationOptions = time: AnimationTime