Skip to content

Commit

Permalink
Added missing calculate parameter in Object.isOnScreen.
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptspry committed Feb 24, 2018
1 parent 71b2801 commit 8322873
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mixins/object_geometry.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@
}
}
// no points on screen, check intersection with absolute coordinates
if (this.intersectsWithRect(pointTL, pointBR, true)) {
if (this.intersectsWithRect(pointTL, pointBR, true, calculate)) {
return true;
}
// worst case scenario the object is so big that contains the screen
var centerPoint = { x: (pointTL.x + pointBR.x) / 2, y: (pointTL.y + pointBR.y) / 2 };
if (this.containsPoint(centerPoint, null, true)) {
if (this.containsPoint(centerPoint, null, true, calculate)) {
return true;
}
return false;
Expand Down
1 change: 1 addition & 0 deletions test/unit/object_geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@
cObj.setCoords();
assert.ok(cObj.isOnScreen(), 'object is onScreen');
cObj.top = 1000;
assert.ok(!cObj.isOnScreen(true), 'object is not onScreen with top 1000 with calculate true and no setCoords call');
cObj.setCoords();
assert.ok(!cObj.isOnScreen(), 'object is not onScreen with top 1000');
canvas.setZoom(0.1);
Expand Down

0 comments on commit 8322873

Please sign in to comment.