diff --git a/framer/Components/ScrollComponent.coffee b/framer/Components/ScrollComponent.coffee index 125248070..cfe3d1ca1 100644 --- a/framer/Components/ScrollComponent.coffee +++ b/framer/Components/ScrollComponent.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", diff --git a/framer/Utils.coffee b/framer/Utils.coffee index 8730bb4b0..4af8dd543 100644 --- a/framer/Utils.coffee +++ b/framer/Utils.coffee @@ -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 =