Skip to content

Commit

Permalink
Fixing animationg of fontSize and lineHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
nvh committed Jul 17, 2017
1 parent 9fe65a5 commit 962b105
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions framer/TextLayer.coffee
Expand Up @@ -44,6 +44,8 @@ class exports.TextLayer extends Layer
if options.styledText?
@styledTextOptions = options.styledText
options.color ?= @_styledText.getStyle("color")
options.fontSize ?= parseFloat(@_styledText.getStyle("fontSize"))
options.lineHeight ?= parseFloat(@_styledText.getStyle("lineHeight"))
else
_.defaults options,
backgroundColor: "transparent"
Expand Down
10 changes: 10 additions & 0 deletions test/tests/TextLayerTest.coffee
Expand Up @@ -66,6 +66,16 @@ describe "TextLayer", ->
text.animate
color: "red"

it "should start animating from the fontsize the layer has", (done) ->
text = new TextLayer
styledText: simpleStyledTextOptions

text.onAnimationStart ->
text.fontSize.should.equal 16
done()
#
text.animate
color: "red"
describe "Auto-sizing", ->

it "should auto size the layer the size of the text", ->
Expand Down

0 comments on commit 962b105

Please sign in to comment.