Permalink
Browse files

Fix more frame bugs

  • Loading branch information...
koenbok committed Apr 3, 2015
1 parent 6dda6c6 commit 2b7855d36c077152553ac98bd4de233a4fcd86d6
Showing with 11 additions and 3 deletions.
  1. +2 −2 framer/Components/ScrollComponent.coffee
  2. +9 −1 framer/Utils.coffee
@@ -82,7 +82,7 @@ class exports.ScrollComponent extends Layer
super options
@_contentInset = options.contentInset or Utils.zeroRect()
@_contentInset = options.contentInset or Utils.rectZero()
@setContentLayer(new Layer)
# Because we did not have a content layer before, we want to re-apply
@@ -216,7 +216,7 @@ class exports.ScrollComponent extends Layer
get: ->
_.clone(@_contentInset)
set: (contentInset) ->
@_contentInset = Utils.zeroRect(Utils.parseRect(contentInset))
@_contentInset = Utils.rectZero(Utils.parseRect(contentInset))
@updateContent()
@define "direction",
View
@@ -495,6 +495,9 @@ Utils.loadImage = (url, callback, context) ->
# Point
Utils.pointZero = (args={}) ->
return _.defaults(args, {x:0, y:0})
Utils.pointMin = ->
points = Utils.arrayFromArguments arguments
point =
@@ -532,6 +535,9 @@ Utils.pointInFrame = (point, frame) ->
# Size
Utils.sizeZero = (args={}) ->
return _.defaults(args, {width:0, height:0})
Utils.sizeMin = ->
sizes = Utils.arrayFromArguments arguments
size =
@@ -546,7 +552,7 @@ Utils.sizeMax = ->
# Rect
Utils.zeroRect = (args={}) ->
Utils.rectZero = (args={}) ->
return _.defaults(args, {top:0, right:0, bottom:0, left:0})
Utils.parseRect = (args) ->
@@ -592,6 +598,8 @@ Utils.frameGetMaxY = (frame) ->
Utils.frameSetMaxY = (frame, value) ->
frame.y = if frame.height is 0 then 0 else value - frame.height
Utils.frameZero = (args={}) ->
return _.defaults(args, {top:0, right:0, bottom:0, left:0})
Utils.frameSize = (frame) ->
size =

0 comments on commit 2b7855d

Please sign in to comment.