Permalink
Browse files

Early return when there is no auto-sizing needed

Fixes #533
  • Loading branch information...
nvh committed Oct 3, 2017
1 parent e5c0723 commit b274bf2e8ae04927b3dc371796aae9f150edfef1
Showing with 3 additions and 2 deletions.
  1. +3 −2 framer/TextLayer.coffee
View
@@ -206,7 +206,7 @@ class exports.TextLayer extends Layer
set: (value) ->
@clip = _.isString(value)
@_styledText.setTextOverflow(value)
@renderText()
@renderText(true)
@define "truncate",
get: -> @textOverflow is "ellipsis"
@@ -252,10 +252,11 @@ class exports.TextLayer extends Layer
@renderText()
@emit("change:text", value)
renderText: =>
renderText: (forceRender = false) =>
return if @__constructor
@_styledText.render()
@_updateHTMLScale()
return unless forceRender or @autoHeight or @autoWidth or @textOverflow isnt null
parentWidth = if @parent? then @parent.width else Screen.width
constrainedWidth = if @autoWidth then parentWidth else @size.width
padding = Utils.rectZero(Utils.parseRect(@padding))

0 comments on commit b274bf2

Please sign in to comment.