Permalink
Browse files

Making autosizing work with Align.center

  • Loading branch information...
nvh committed Mar 10, 2017
1 parent 9bc528c commit 877442105c94a3558be9481b83ea999cde0813ca
Showing with 13 additions and 0 deletions.
  1. +4 −0 framer/TextLayer.coffee
  2. +9 −0 test/tests/TextLayerTest.coffee
View
@@ -51,6 +51,10 @@ class exports.TextLayer extends Layer
# Reset width and height
@autoSize()
for key, value of options
if _.isFunction(value) and @[key]?
@[key] = value
# Calculate new height on font property changes
for property in @constructor._textProperties
@@ -141,6 +141,15 @@ describe "TextLayer", ->
text.parent = parent
text.size.should.eql width: 80, height: 116
it "should work together with Align.center", ->
text = new TextLayer
fontFamily: "Courier, Liberation Mono"
fontSize: 5
x: Align.center
y: Align.center
text: shortText
text.point.should.eql x: 180, y: 147
describe "Padding", ->
it "should have no padding initially", ->
text = new TextLayer

0 comments on commit 8774421

Please sign in to comment.