mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Remove Tool#setDocument().
This commit is contained in:
parent
2f6fbcba74
commit
ef8a2aad9b
1 changed files with 7 additions and 11 deletions
|
@ -89,23 +89,19 @@ var Tool = this.Tool = ToolHandler.extend(new function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (paper.document)
|
if (paper.document) {
|
||||||
this.setDocument(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() {
|
getDocument: function() {
|
||||||
return this._document;
|
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}
|
* The fixed time delay between each call to the {@link #onMouseDrag}
|
||||||
* event. Setting this to an interval means the {@link #onMouseDrag}
|
* event. Setting this to an interval means the {@link #onMouseDrag}
|
||||||
|
|
Loading…
Reference in a new issue