From ef8a2aad9b08b8fa259e622f50f1f5de01c303cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 7 May 2011 14:50:31 +0100 Subject: [PATCH] Remove Tool#setDocument(). --- src/tool/Tool.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) 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}