mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -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.
|
||||
paper = scope;
|
||||
var view = scope.getView(),
|
||||
// Only create a tool object if something resembling a tool handler
|
||||
// definition is contained in the code.
|
||||
tool = /\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/.test(code)
|
||||
? new Tool()
|
||||
: null,
|
||||
// Only create a tool if the tool object is accessed or something
|
||||
// resembling a global tool handler is contained in the code.
|
||||
tool = /\btool\.\w+|\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/
|
||||
.test(code) ? new Tool() : null,
|
||||
toolHandlers = tool ? tool._events : [],
|
||||
// Compile a list of all handlers that can be defined globally
|
||||
// inside the PaperScript. These are passed on to the function as
|
||||
|
|
Loading…
Reference in a new issue