From 291d9ad9ad0d344dd3d275c21d741e8878e0711a Mon Sep 17 00:00:00 2001 From: Peter Ajtai Date: Tue, 16 Oct 2012 22:01:22 -0700 Subject: [PATCH] Update src/viewport.js Adding some code reuse adding missing paren adding missing paren --- src/viewport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viewport.js b/src/viewport.js index 0cca9e0..fc4873f 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -72,7 +72,7 @@ jaws.Viewport = function ViewPort(options) { /** Returns true if item is inside viewport */ this.isInside = function(item) { - return( item.x >= that.x && item.x <= (that.x + that.width) && item.y >= that.y && item.y <= (that.y + that.height) ) + return( (! that.isLeftOf(item)) && (! that.isRightOf(item)) && (! that.isAbove(item)) && (! that.isBelow(item)) ) }; /** Returns true if item is partly (down to 1 pixel) inside viewport */