mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-10 14:52:48 -05:00
10d5de3ed6
This change also simplified the way classes are exported to PaperScope objects.
45 lines
857 B
JavaScript
45 lines
857 B
JavaScript
/*
|
|
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
|
* http://paperjs.org/
|
|
*
|
|
* Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey
|
|
* http://lehni.org/ & http://jonathanpuckey.com/
|
|
*
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
*
|
|
* All rights reserved.
|
|
*/
|
|
|
|
/**
|
|
* @name Event
|
|
* @class
|
|
*/
|
|
var Event = Base.extend(/** @lends Event# */{
|
|
initialize: function Event(event) {
|
|
this.event = event;
|
|
},
|
|
|
|
preventDefault: function() {
|
|
this._prevented = true;
|
|
DomEvent.preventDefault(this.event);
|
|
},
|
|
|
|
stopPropagation: function() {
|
|
this._stopped = true;
|
|
DomEvent.stopPropagation(this.event);
|
|
},
|
|
|
|
stop: function() {
|
|
this.stopPropagation();
|
|
this.preventDefault();
|
|
},
|
|
|
|
// DOCS: Document Event#modifiers
|
|
/**
|
|
* @type object
|
|
* @bean
|
|
*/
|
|
getModifiers: function() {
|
|
return Key.modifiers;
|
|
}
|
|
});
|