Permalink
Browse files

Setting default property of shadowType to undefined instead of null

Fixes the shadowType not being captured correctly in the default state
  • Loading branch information...
nvh committed Sep 18, 2017
1 parent f14b32f commit 266f5915c148b2828aacbbbefede5a8597717dbc
Showing with 11 additions and 1 deletion.
  1. +1 −1 framer/Layer.coffee
  2. +10 −0 test/tests/LayerStatesTest.coffee
@@ -377,7 +377,7 @@ class exports.Layer extends BaseClass
@define "shadowBlur", layerProperty(@, "shadowBlur", null, 0, _.isNumber, null, {}, updateShadowsProperty("blur"))
@define "shadowSpread", layerProperty(@, "shadowSpread", null, 0, _.isNumber, null, {}, updateShadowsProperty("spread"))
@define "shadowColor", layerProperty(@, "shadowColor", null, "", Color.validColorValue, Color.toColor, {}, updateShadowsProperty("color"))
@define "shadowType", layerProperty(@, "shadowType", null, null, null, null, {}, updateShadowsProperty("type"))
@define "shadowType", layerProperty(@, "shadowType", null, undefined, null, null, {}, updateShadowsProperty("type"))
@define "shadows",
default: null
get: ->
@@ -441,6 +441,16 @@ describe "LayerStates", ->
layer.states.current.name.should.equal initialStateName
layer.states.default.x.should.equal 100

it "should capture shadowType as part of the default state", ->
l = new Layer
size: 60
borderRadius: 30
backgroundColor: "red"
shadowColor: "blue"
shadowSpread: 10
l.stateSwitch "default"
l.style.boxShadow.should.equal "rgb(0, 0, 255) 0px 0px 0px 10px"

it "should listen to options provided to stateCycle", ->
layer = new Layer
layer.states =

0 comments on commit 266f591

Please sign in to comment.