Remove Tool#setDocument().

This commit is contained in:
Jürg Lehni 2011-05-07 14:50:31 +01:00
parent 2f6fbcba74
commit ef8a2aad9b

View file

@ -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}