mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Add alternative code for setting handler on tool that does not rely on eval(), commented out for now.
This commit is contained in:
parent
5bc2889f1c
commit
690a79722f
1 changed files with 11 additions and 0 deletions
|
@ -145,6 +145,17 @@ var PaperScript = this.PaperScript = new function() {
|
|||
onFrame, onResize;
|
||||
var res = eval(compile(code));
|
||||
if (tool) {
|
||||
// We could do this instead to avoid eval(), but it's more code:
|
||||
// tool.onEditOptions = onEditOptions;
|
||||
// tool.onSelect = onSelect;
|
||||
// tool.onDeselect = onDeselect;
|
||||
// tool.onReselect = onReselect;
|
||||
// tool.onMouseDown = onMouseDown;
|
||||
// tool.onMouseUp = onMouseUp;
|
||||
// tool.onMouseDrag = onMouseDrag;
|
||||
// tool.onMouseMove = onMouseMove;
|
||||
// tool.onKeyDown = onKeyDown;
|
||||
// tool.onKeyUp = onKeyUp;
|
||||
Base.each(['onEditOptions', 'onSelect', 'onDeselect',
|
||||
'onReselect', 'onMouseDown', 'onMouseUp', 'onMouseDrag',
|
||||
'onMouseMove', 'onKeyDown', 'onKeyUp'],
|
||||
|
|
Loading…
Reference in a new issue