mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
parent
27197bd156
commit
dbd7a90e23
1 changed files with 4 additions and 5 deletions
|
@ -386,11 +386,10 @@ Base.exports.PaperScript = (function() {
|
||||||
// Set currently active scope.
|
// Set currently active scope.
|
||||||
paper = scope;
|
paper = scope;
|
||||||
var view = scope.getView(),
|
var view = scope.getView(),
|
||||||
// Only create a tool object if something resembling a tool handler
|
// Only create a tool if the tool object is accessed or something
|
||||||
// definition is contained in the code.
|
// resembling a global tool handler is contained in the code.
|
||||||
tool = /\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/.test(code)
|
tool = /\btool\.\w+|\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/
|
||||||
? new Tool()
|
.test(code) ? new Tool() : null,
|
||||||
: null,
|
|
||||||
toolHandlers = tool ? tool._events : [],
|
toolHandlers = tool ? tool._events : [],
|
||||||
// Compile a list of all handlers that can be defined globally
|
// Compile a list of all handlers that can be defined globally
|
||||||
// inside the PaperScript. These are passed on to the function as
|
// inside the PaperScript. These are passed on to the function as
|
||||||
|
|
Loading…
Reference in a new issue