mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 22:29:11 -04:00
More work to make new events mechanisms work for Tool too.
This commit is contained in:
parent
5fd7753c60
commit
e238dea3ac
4 changed files with 61 additions and 56 deletions
src/core
|
@ -169,10 +169,7 @@ var PaperScript = this.PaperScript = new function() {
|
|||
(function() {
|
||||
var onEditOptions, onSelect, onDeselect, onReselect, onMouseDown,
|
||||
onMouseUp, onMouseDrag, onMouseMove, onKeyDown, onKeyUp,
|
||||
onFrame, onResize,
|
||||
handlers = [ 'onEditOptions', 'onSelect', 'onDeselect',
|
||||
'onReselect', 'onMouseDown', 'onMouseUp', 'onMouseDrag',
|
||||
'onMouseMove', 'onKeyDown', 'onKeyUp'];
|
||||
onFrame, onResize;
|
||||
res = eval(compile(code));
|
||||
if (tool) {
|
||||
// We could do this instead to avoid eval(), but it's longer
|
||||
|
@ -186,7 +183,7 @@ var PaperScript = this.PaperScript = new function() {
|
|||
// tool.onMouseMove = onMouseMove;
|
||||
// tool.onKeyDown = onKeyDown;
|
||||
// tool.onKeyUp = onKeyUp;
|
||||
Base.each(handlers, function(key) {
|
||||
Base.each(tool._events, function(key) {
|
||||
tool[key] = eval(key);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue