diff --git a/src/tool/Tool.js b/src/tool/Tool.js index 21c811e3..fd5e5d5b 100644 --- a/src/tool/Tool.js +++ b/src/tool/Tool.js @@ -89,23 +89,19 @@ var Tool = this.Tool = ToolHandler.extend(new function() { } }; - if (paper.document) - this.setDocument(paper.document); - + if (paper.document) { + // Remove old events first. + if (this._document) + Event.remove(this._document.canvas, this.events); + this._document = doc || paper.document; + Event.add(doc.canvas, this.events); + } }, getDocument: function() { return this._document; }, - setDocument: function(doc) { - // Remove old events first. - if (this._document) - Event.remove(this._document.canvas, this.events); - this._document = doc || paper.document; - Event.add(doc.canvas, this.events); - }, - /** * The fixed time delay between each call to the {@link #onMouseDrag} * event. Setting this to an interval means the {@link #onMouseDrag}