Permalink
Browse files

Fix bug with TextLayers and default states

  • Loading branch information...
nvh committed Mar 9, 2017
1 parent 6281e9b commit 3ee7a066284ef0a506c340032d1af79ade4d90e1
Binary file not shown.
View
@@ -114,7 +114,7 @@ class exports.TextLayer extends Layer
@style.padding =
"#{@_padding.top}px #{@_padding.right}px #{@_padding.bottom}px #{@_padding.left}px"
@define "fontFamily", layerProperty(@, "fontFamily", "fontFamily", @defaultFont(), _.isString)
@define "fontFamily", layerProperty(@, "fontFamily", "fontFamily", @defaultFont(), _.isString, null, {}, (layer, value) -> layer.font = value)
@define "fontSize", layerProperty(@, "fontSize", "fontSize", null, _.isNumber)
@define "fontWeight", layerProperty(@, "fontWeight", "fontWeight")
@define "fontStyle", layerProperty(@, "fontStyle", "fontStyle", "normal", _.isString)
@@ -30,6 +30,11 @@ describe "TextLayer", ->
font: "Monaco"
text.fontFamily.should.equal "Monaco"
it "should set the font property if the fontFamily property is set", ->
text = new TextLayer
fontFamily: "Monaco"
text.font.should.equal "Monaco"
describe "Auto-sizing", ->
it "should auto size the layer the size of the text", ->

0 comments on commit 3ee7a06

Please sign in to comment.