Skip to content
Browse files

Fix exception if there is no content layer set

  • Loading branch information
Koen Bok
Koen Bok committed Apr 11, 2016
1 parent 01e2794 commit 7aefc85b3c2a84cb857fb8a98277f8cb3009e235
Showing with 4 additions and 0 deletions.
  1. +4 −0 framer/Components/
@@ -93,6 +93,8 @@ class exports.ScrollComponent extends Layer

calculateContentFrame: ->

return Utils.rectZero() unless @content

# Calculates the size of the content. By default this returns the total
# size of all the content layers based on width and height. You can override
# this for example to take scaling into account.
@@ -227,6 +229,8 @@ class exports.ScrollComponent extends Layer
set: (contentInset) ->
@_contentInset = Utils.rectZero(Utils.parseRect(contentInset))

return unless @content

# If we reset the content inset, we need to reset the content position
contentFrame = @calculateContentFrame()
contentFrame.x = contentFrame.x + @_contentInset.left

0 comments on commit 7aefc85

Please sign in to comment.
You can’t perform that action at this time.