mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 22:29:11 -04:00
Commit beginning of item based mouse events. So far only onMousedown / 'mousedown' is supported.
This commit is contained in:
parent
18d44689fa
commit
e4586cfeeb
6 changed files with 132 additions and 9 deletions
src/ui
42
src/ui/MouseEvent.js
Normal file
42
src/ui/MouseEvent.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Paper.js
|
||||
*
|
||||
* This file is part of Paper.js, a JavaScript Vector Graphics Library,
|
||||
* based on Scriptographer.org and designed to be largely API compatible.
|
||||
* http://paperjs.org/
|
||||
* http://scriptographer.org/
|
||||
*
|
||||
* Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
|
||||
* http://lehni.org/ & http://jonathanpuckey.com/
|
||||
*
|
||||
* Distributed under the MIT license. See LICENSE file for details.
|
||||
*
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name MouseEvent
|
||||
*
|
||||
* @extends Event
|
||||
*/
|
||||
var MouseEvent = this.MouseEvent = Event.extend(new function() {
|
||||
return /** @lends MouseEvent# */{
|
||||
initialize: function(type, point, target, event) {
|
||||
this.base(event);
|
||||
this.type = type;
|
||||
this.point = point;
|
||||
this.target = target;
|
||||
},
|
||||
|
||||
/**
|
||||
* @return {String} A string representation of the key event.
|
||||
*/
|
||||
toString: function() {
|
||||
return '{ type: ' + this.type
|
||||
+ ', point: ' + this.point
|
||||
+ ', target: ' + this.target
|
||||
+ ', modifiers: ' + this.getModifiers()
|
||||
+ ' }';
|
||||
}
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue