Skip to content
Permalink
Browse files

Fix contentInset for ScrollComponent

This was due to: b961fbf?diff=unified
  • Loading branch information...
Koen Bok
Koen Bok committed Apr 11, 2016
1 parent c526d80 commit 01e27947a4ecbb10d127269be200836422017e5b
Showing with 8 additions and 1 deletion.
  1. +8 −1 framer/Components/ScrollComponent.coffee
@@ -126,6 +126,7 @@ class exports.ScrollComponent extends Layer
@on("change:height", @updateContent)

@updateContent()

@scrollPoint = {x:0, y:0}

return @_content
@@ -141,7 +142,7 @@ class exports.ScrollComponent extends Layer
# call it yourself, but make sure you don't overdo it.

return unless @content

contentFrame = @calculateContentFrame()
@content.width = contentFrame.width
@content.height = contentFrame.height
@@ -225,6 +226,12 @@ class exports.ScrollComponent extends Layer
_.clone(@_contentInset)
set: (contentInset) ->
@_contentInset = Utils.rectZero(Utils.parseRect(contentInset))

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

@define "direction",

0 comments on commit 01e2794

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