Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix exception if there is no content layer set
- Loading branch information
Showing
with
4 additions
and
0 deletions.
-
+4
−0
framer/Components/ScrollComponent.coffee
|
@@ -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 |
|
|