mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Remove all parameters from Tool constructor, to simplify use outside PaperScript.
This commit is contained in:
parent
9f1f4d334e
commit
688c1671ed
2 changed files with 6 additions and 8 deletions
|
@ -150,15 +150,15 @@ var PaperScript = this.PaperScript = new function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//#endif // BROWSER
|
//#endif // BROWSER
|
||||||
|
// Set currently active scope.
|
||||||
|
paper = scope;
|
||||||
var view = scope.view,
|
var view = scope.view,
|
||||||
// TODO: Add support for multiple tools
|
// TODO: Add support for multiple tools
|
||||||
tool = scope.tool = /on(?:Key|Mouse)(?:Up|Down|Move|Drag)/.test(code)
|
tool = scope.tool = /on(?:Key|Mouse)(?:Up|Down|Move|Drag)/.test(code)
|
||||||
&& new Tool(null, scope),
|
&& new Tool(),
|
||||||
res;
|
res;
|
||||||
// Define variables for potential handlers, so eval() calls below to
|
// Define variables for potential handlers, so eval() calls below to
|
||||||
// fetch their values do not require try-catch around them.
|
// fetch their values do not require try-catch around them.
|
||||||
// Set currently active scope.
|
|
||||||
paper = scope;
|
|
||||||
// Use with(){} in order to make the scope the current 'global' scope
|
// Use with(){} in order to make the scope the current 'global' scope
|
||||||
// instead of window.
|
// instead of window.
|
||||||
with (scope) {
|
with (scope) {
|
||||||
|
|
|
@ -48,11 +48,9 @@
|
||||||
*/
|
*/
|
||||||
var Tool = this.Tool = Base.extend(/** @lends Tool# */{
|
var Tool = this.Tool = Base.extend(/** @lends Tool# */{
|
||||||
// DOCS: rewrite Tool constructor explanation
|
// DOCS: rewrite Tool constructor explanation
|
||||||
/**
|
initialize: function() {
|
||||||
* Initializes the tool's settings, so a new tool can be assigned to it
|
// Store reference to the currently active global paper scope:
|
||||||
*/
|
this._scope = paper;
|
||||||
initialize: function(handlers, scope) {
|
|
||||||
this._scope = scope;
|
|
||||||
this._firstMove = true;
|
this._firstMove = true;
|
||||||
this._count = 0;
|
this._count = 0;
|
||||||
this._downCount = 0;
|
this._downCount = 0;
|
||||||
|
|
Loading…
Reference in a new issue