Skip to content

Commit

Permalink
Remove recursion warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Mar 3, 2013
1 parent 195bc32 commit ce84996
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/modes/canvas/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ module.exports = Class(Node, Container, {
},

localHitTest: function(x, y){
var i = 0;
var node = this.lastChild;
while (node){
var hit = node.hitTest(x, y);
if (hit) return hit;
node = node.previousSibling;
if (i++ > 100){ debugger; throw new Error('recursion'); }
}
return null;
},
Expand All @@ -34,12 +32,10 @@ module.exports = Class(Node, Container, {
yx = t * this.xx + yy * this.yx;
yy = t * this.xy + yy * this.yy;

var i = 0;
var node = this.firstChild;
while (node){
node.renderTo(context, xx, yx, xy, yy, x, y);
node = node.nextSibling;
if (i++ > 100){ debugger; throw new Error('recursion'); }
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/modes/canvas/surface.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,11 @@ var CanvasSurface = Class(Element, Container, {

hitTest: function(x, y){
if (x < 0 || y < 0 || x > this.width || y > this.height) return null;
var i = 0;
var node = this.lastChild;
while (node){
var hit = node.hitTest(x, y);
if (hit) return hit;
node = node.previousSibling;
if (i++ > 100){ debugger; throw new Error('recursion'); }
}
return null;
},
Expand All @@ -126,11 +124,9 @@ var CanvasSurface = Class(Element, Container, {
var node = this.firstChild, context = this.context;
context.setTransform(1, 0, 0, 1, 0, 0);
context.clearRect(0, 0, this.width, this.height);
var i = 0;
while (node){
node.renderTo(context, 1, 0, 0, 1, 0, 0);
node = node.nextSibling;
if (i++ > 100){ debugger; throw new Error('recursion'); }
}
this.refreshCursor();
}
Expand Down

0 comments on commit ce84996

Please sign in to comment.