mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Prebuilt module for commit 724bcb2e35
This commit is contained in:
parent
cb7d566921
commit
1e121e017f
5 changed files with 180 additions and 114 deletions
94
dist/docs/assets/js/paper.js
vendored
94
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Tue Jun 14 16:15:50 2016 +0200
|
* Date: Tue Jun 14 16:52:31 2016 +0200
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -12092,15 +12092,16 @@ new function() {
|
||||||
mousedrag: 'mousemove'
|
mousedrag: 'mousemove'
|
||||||
};
|
};
|
||||||
|
|
||||||
function emitMouseEvent(obj, type, event, point, prevPoint, stopItem) {
|
function emitMouseEvent(obj, target, type, event, point, prevPoint,
|
||||||
var target = obj,
|
stopItem) {
|
||||||
stopped = false,
|
var stopped = false,
|
||||||
mouseEvent;
|
mouseEvent;
|
||||||
|
|
||||||
function emit(obj, type) {
|
function emit(obj, type) {
|
||||||
if (obj.responds(type)) {
|
if (obj.responds(type)) {
|
||||||
if (!mouseEvent) {
|
if (!mouseEvent) {
|
||||||
mouseEvent = new MouseEvent(type, event, point, target,
|
mouseEvent = new MouseEvent(type, event, point,
|
||||||
|
target || obj,
|
||||||
prevPoint ? point.subtract(prevPoint) : null);
|
prevPoint ? point.subtract(prevPoint) : null);
|
||||||
}
|
}
|
||||||
if (obj.emit(type, mouseEvent)) {
|
if (obj.emit(type, mouseEvent)) {
|
||||||
|
@ -12125,15 +12126,18 @@ new function() {
|
||||||
return stopped;
|
return stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
function emitMouseEvents(view, item, type, event, point, prevPoint) {
|
function emitMouseEvents(view, hitItem, hitTest, type, event, point,
|
||||||
|
prevPoint) {
|
||||||
view._project.removeOn(type);
|
view._project.removeOn(type);
|
||||||
prevented = called = false;
|
prevented = called = false;
|
||||||
return (dragItem && emitMouseEvent(dragItem, type, event, point,
|
return (dragItem && emitMouseEvent(dragItem, null, type, event,
|
||||||
prevPoint)
|
point, prevPoint)
|
||||||
|| item && item !== dragItem && !item.isDescendant(dragItem)
|
|| hitItem && hitItem !== dragItem
|
||||||
&& emitMouseEvent(item, fallbacks[type] || type, event, point,
|
&& !hitItem.isDescendant(dragItem)
|
||||||
prevPoint, dragItem)
|
&& emitMouseEvent(hitItem, null, fallbacks[type] || type, event,
|
||||||
|| emitMouseEvent(view, type, event, point, prevPoint));
|
point, prevPoint, dragItem)
|
||||||
|
|| emitMouseEvent(view, dragItem || hitItem || hitTest, type, event,
|
||||||
|
point, prevPoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
var itemEventsMap = {
|
var itemEventsMap = {
|
||||||
|
@ -12189,51 +12193,62 @@ new function() {
|
||||||
point = this.getEventPoint(event);
|
point = this.getEventPoint(event);
|
||||||
|
|
||||||
var inView = this.getBounds().contains(point),
|
var inView = this.getBounds().contains(point),
|
||||||
hit = hitItems && inView && this._project.hitTest(point, {
|
hitItem = undefined,
|
||||||
tolerance: 0,
|
|
||||||
fill: true,
|
|
||||||
stroke: true
|
|
||||||
}),
|
|
||||||
item = hit && hit.item || null,
|
|
||||||
handle = false,
|
handle = false,
|
||||||
mouse = {};
|
mouse = {};
|
||||||
mouse[type.substr(5)] = true;
|
mouse[type.substr(5)] = true;
|
||||||
|
|
||||||
if (hitItems && item !== overItem) {
|
function hitTest() {
|
||||||
|
if (hitItem === undefined) {
|
||||||
|
var hit = inView && view._project.hitTest(point, {
|
||||||
|
tolerance: 0,
|
||||||
|
fill: true,
|
||||||
|
stroke: true
|
||||||
|
});
|
||||||
|
hitItem = hit && hit.item || null;
|
||||||
|
}
|
||||||
|
return hitItem || view;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hitItems)
|
||||||
|
hitTest();
|
||||||
|
if (hitItems && hitItem !== overItem) {
|
||||||
if (overItem) {
|
if (overItem) {
|
||||||
emitMouseEvent(overItem, 'mouseleave', event, point);
|
emitMouseEvent(overItem, null, 'mouseleave', event, point);
|
||||||
}
|
}
|
||||||
if (item) {
|
if (hitItem) {
|
||||||
emitMouseEvent(item, 'mouseenter', event, point);
|
emitMouseEvent(hitItem, null, 'mouseenter', event, point);
|
||||||
}
|
}
|
||||||
overItem = item;
|
overItem = hitItem;
|
||||||
}
|
}
|
||||||
if (wasInView ^ inView) {
|
if (wasInView ^ inView) {
|
||||||
emitMouseEvent(this, inView ? 'mouseenter' : 'mouseleave',
|
emitMouseEvent(this, null, inView ? 'mouseenter' : 'mouseleave',
|
||||||
event, point);
|
event, point);
|
||||||
overView = inView ? this : null;
|
overView = inView ? this : null;
|
||||||
handle = true;
|
handle = true;
|
||||||
}
|
}
|
||||||
if ((inView || mouse.drag) && !point.equals(lastPoint)) {
|
if ((inView || mouse.drag) && !point.equals(lastPoint)) {
|
||||||
emitMouseEvents(this, item, nativeMove ? type : 'mousemove',
|
emitMouseEvents(this, hitItem, hitTest,
|
||||||
event, point, lastPoint);
|
nativeMove ? type : 'mousemove', event,
|
||||||
|
point, lastPoint);
|
||||||
handle = true;
|
handle = true;
|
||||||
}
|
}
|
||||||
wasInView = inView;
|
wasInView = inView;
|
||||||
if (mouse.down && inView || mouse.up && downPoint) {
|
if (mouse.down && inView || mouse.up && downPoint) {
|
||||||
emitMouseEvents(this, item, type, event, point, downPoint);
|
emitMouseEvents(this, hitItem, hitTest, type, event,
|
||||||
|
point, downPoint);
|
||||||
if (mouse.down) {
|
if (mouse.down) {
|
||||||
dblClick = item === clickItem
|
dblClick = hitItem === clickItem
|
||||||
&& (Date.now() - clickTime < 300);
|
&& (Date.now() - clickTime < 300);
|
||||||
downItem = clickItem = item;
|
downItem = clickItem = hitItem;
|
||||||
dragItem = !prevented && item;
|
dragItem = !prevented && hitItem;
|
||||||
downPoint = point;
|
downPoint = point;
|
||||||
} else if (mouse.up) {
|
} else if (mouse.up) {
|
||||||
if (!prevented && item === downItem) {
|
if (!prevented && hitItem === downItem) {
|
||||||
clickTime = Date.now();
|
clickTime = Date.now();
|
||||||
emitMouseEvents(this, item,
|
emitMouseEvents(this, hitItem, hitTest,
|
||||||
dblClick ? 'doubleclick' : 'click',
|
dblClick ? 'doubleclick' : 'click', event,
|
||||||
event, point, downPoint);
|
point, downPoint);
|
||||||
dblClick = false;
|
dblClick = false;
|
||||||
}
|
}
|
||||||
downItem = dragItem = null;
|
downItem = dragItem = null;
|
||||||
|
@ -12576,14 +12591,21 @@ var MouseEvent = Event.extend({
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.event = event;
|
this.event = event;
|
||||||
this.point = point;
|
this.point = point;
|
||||||
this.target = target;
|
this._target = target;
|
||||||
this.delta = delta;
|
this.delta = delta;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getTarget: function() {
|
||||||
|
var target = this._target;
|
||||||
|
if (typeof target === 'function')
|
||||||
|
target = this._target = target();
|
||||||
|
return target;
|
||||||
|
},
|
||||||
|
|
||||||
toString: function() {
|
toString: function() {
|
||||||
return "{ type: '" + this.type
|
return "{ type: '" + this.type
|
||||||
+ "', point: " + this.point
|
+ "', point: " + this.point
|
||||||
+ ', target: ' + this.target
|
+ ', target: ' + this.getTarget()
|
||||||
+ (this.delta ? ', delta: ' + this.delta : '')
|
+ (this.delta ? ', delta: ' + this.delta : '')
|
||||||
+ ', modifiers: ' + this.getModifiers()
|
+ ', modifiers: ' + this.getModifiers()
|
||||||
+ ' }';
|
+ ' }';
|
||||||
|
|
94
dist/paper-core.js
vendored
94
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Tue Jun 14 16:15:50 2016 +0200
|
* Date: Tue Jun 14 16:52:31 2016 +0200
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -12092,15 +12092,16 @@ new function() {
|
||||||
mousedrag: 'mousemove'
|
mousedrag: 'mousemove'
|
||||||
};
|
};
|
||||||
|
|
||||||
function emitMouseEvent(obj, type, event, point, prevPoint, stopItem) {
|
function emitMouseEvent(obj, target, type, event, point, prevPoint,
|
||||||
var target = obj,
|
stopItem) {
|
||||||
stopped = false,
|
var stopped = false,
|
||||||
mouseEvent;
|
mouseEvent;
|
||||||
|
|
||||||
function emit(obj, type) {
|
function emit(obj, type) {
|
||||||
if (obj.responds(type)) {
|
if (obj.responds(type)) {
|
||||||
if (!mouseEvent) {
|
if (!mouseEvent) {
|
||||||
mouseEvent = new MouseEvent(type, event, point, target,
|
mouseEvent = new MouseEvent(type, event, point,
|
||||||
|
target || obj,
|
||||||
prevPoint ? point.subtract(prevPoint) : null);
|
prevPoint ? point.subtract(prevPoint) : null);
|
||||||
}
|
}
|
||||||
if (obj.emit(type, mouseEvent)) {
|
if (obj.emit(type, mouseEvent)) {
|
||||||
|
@ -12125,15 +12126,18 @@ new function() {
|
||||||
return stopped;
|
return stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
function emitMouseEvents(view, item, type, event, point, prevPoint) {
|
function emitMouseEvents(view, hitItem, hitTest, type, event, point,
|
||||||
|
prevPoint) {
|
||||||
view._project.removeOn(type);
|
view._project.removeOn(type);
|
||||||
prevented = called = false;
|
prevented = called = false;
|
||||||
return (dragItem && emitMouseEvent(dragItem, type, event, point,
|
return (dragItem && emitMouseEvent(dragItem, null, type, event,
|
||||||
prevPoint)
|
point, prevPoint)
|
||||||
|| item && item !== dragItem && !item.isDescendant(dragItem)
|
|| hitItem && hitItem !== dragItem
|
||||||
&& emitMouseEvent(item, fallbacks[type] || type, event, point,
|
&& !hitItem.isDescendant(dragItem)
|
||||||
prevPoint, dragItem)
|
&& emitMouseEvent(hitItem, null, fallbacks[type] || type, event,
|
||||||
|| emitMouseEvent(view, type, event, point, prevPoint));
|
point, prevPoint, dragItem)
|
||||||
|
|| emitMouseEvent(view, dragItem || hitItem || hitTest, type, event,
|
||||||
|
point, prevPoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
var itemEventsMap = {
|
var itemEventsMap = {
|
||||||
|
@ -12189,51 +12193,62 @@ new function() {
|
||||||
point = this.getEventPoint(event);
|
point = this.getEventPoint(event);
|
||||||
|
|
||||||
var inView = this.getBounds().contains(point),
|
var inView = this.getBounds().contains(point),
|
||||||
hit = hitItems && inView && this._project.hitTest(point, {
|
hitItem = undefined,
|
||||||
tolerance: 0,
|
|
||||||
fill: true,
|
|
||||||
stroke: true
|
|
||||||
}),
|
|
||||||
item = hit && hit.item || null,
|
|
||||||
handle = false,
|
handle = false,
|
||||||
mouse = {};
|
mouse = {};
|
||||||
mouse[type.substr(5)] = true;
|
mouse[type.substr(5)] = true;
|
||||||
|
|
||||||
if (hitItems && item !== overItem) {
|
function hitTest() {
|
||||||
|
if (hitItem === undefined) {
|
||||||
|
var hit = inView && view._project.hitTest(point, {
|
||||||
|
tolerance: 0,
|
||||||
|
fill: true,
|
||||||
|
stroke: true
|
||||||
|
});
|
||||||
|
hitItem = hit && hit.item || null;
|
||||||
|
}
|
||||||
|
return hitItem || view;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hitItems)
|
||||||
|
hitTest();
|
||||||
|
if (hitItems && hitItem !== overItem) {
|
||||||
if (overItem) {
|
if (overItem) {
|
||||||
emitMouseEvent(overItem, 'mouseleave', event, point);
|
emitMouseEvent(overItem, null, 'mouseleave', event, point);
|
||||||
}
|
}
|
||||||
if (item) {
|
if (hitItem) {
|
||||||
emitMouseEvent(item, 'mouseenter', event, point);
|
emitMouseEvent(hitItem, null, 'mouseenter', event, point);
|
||||||
}
|
}
|
||||||
overItem = item;
|
overItem = hitItem;
|
||||||
}
|
}
|
||||||
if (wasInView ^ inView) {
|
if (wasInView ^ inView) {
|
||||||
emitMouseEvent(this, inView ? 'mouseenter' : 'mouseleave',
|
emitMouseEvent(this, null, inView ? 'mouseenter' : 'mouseleave',
|
||||||
event, point);
|
event, point);
|
||||||
overView = inView ? this : null;
|
overView = inView ? this : null;
|
||||||
handle = true;
|
handle = true;
|
||||||
}
|
}
|
||||||
if ((inView || mouse.drag) && !point.equals(lastPoint)) {
|
if ((inView || mouse.drag) && !point.equals(lastPoint)) {
|
||||||
emitMouseEvents(this, item, nativeMove ? type : 'mousemove',
|
emitMouseEvents(this, hitItem, hitTest,
|
||||||
event, point, lastPoint);
|
nativeMove ? type : 'mousemove', event,
|
||||||
|
point, lastPoint);
|
||||||
handle = true;
|
handle = true;
|
||||||
}
|
}
|
||||||
wasInView = inView;
|
wasInView = inView;
|
||||||
if (mouse.down && inView || mouse.up && downPoint) {
|
if (mouse.down && inView || mouse.up && downPoint) {
|
||||||
emitMouseEvents(this, item, type, event, point, downPoint);
|
emitMouseEvents(this, hitItem, hitTest, type, event,
|
||||||
|
point, downPoint);
|
||||||
if (mouse.down) {
|
if (mouse.down) {
|
||||||
dblClick = item === clickItem
|
dblClick = hitItem === clickItem
|
||||||
&& (Date.now() - clickTime < 300);
|
&& (Date.now() - clickTime < 300);
|
||||||
downItem = clickItem = item;
|
downItem = clickItem = hitItem;
|
||||||
dragItem = !prevented && item;
|
dragItem = !prevented && hitItem;
|
||||||
downPoint = point;
|
downPoint = point;
|
||||||
} else if (mouse.up) {
|
} else if (mouse.up) {
|
||||||
if (!prevented && item === downItem) {
|
if (!prevented && hitItem === downItem) {
|
||||||
clickTime = Date.now();
|
clickTime = Date.now();
|
||||||
emitMouseEvents(this, item,
|
emitMouseEvents(this, hitItem, hitTest,
|
||||||
dblClick ? 'doubleclick' : 'click',
|
dblClick ? 'doubleclick' : 'click', event,
|
||||||
event, point, downPoint);
|
point, downPoint);
|
||||||
dblClick = false;
|
dblClick = false;
|
||||||
}
|
}
|
||||||
downItem = dragItem = null;
|
downItem = dragItem = null;
|
||||||
|
@ -12576,14 +12591,21 @@ var MouseEvent = Event.extend({
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.event = event;
|
this.event = event;
|
||||||
this.point = point;
|
this.point = point;
|
||||||
this.target = target;
|
this._target = target;
|
||||||
this.delta = delta;
|
this.delta = delta;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getTarget: function() {
|
||||||
|
var target = this._target;
|
||||||
|
if (typeof target === 'function')
|
||||||
|
target = this._target = target();
|
||||||
|
return target;
|
||||||
|
},
|
||||||
|
|
||||||
toString: function() {
|
toString: function() {
|
||||||
return "{ type: '" + this.type
|
return "{ type: '" + this.type
|
||||||
+ "', point: " + this.point
|
+ "', point: " + this.point
|
||||||
+ ', target: ' + this.target
|
+ ', target: ' + this.getTarget()
|
||||||
+ (this.delta ? ', delta: ' + this.delta : '')
|
+ (this.delta ? ', delta: ' + this.delta : '')
|
||||||
+ ', modifiers: ' + this.getModifiers()
|
+ ', modifiers: ' + this.getModifiers()
|
||||||
+ ' }';
|
+ ' }';
|
||||||
|
|
6
dist/paper-core.min.js
vendored
6
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
94
dist/paper-full.js
vendored
94
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Tue Jun 14 16:15:50 2016 +0200
|
* Date: Tue Jun 14 16:52:31 2016 +0200
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -12092,15 +12092,16 @@ new function() {
|
||||||
mousedrag: 'mousemove'
|
mousedrag: 'mousemove'
|
||||||
};
|
};
|
||||||
|
|
||||||
function emitMouseEvent(obj, type, event, point, prevPoint, stopItem) {
|
function emitMouseEvent(obj, target, type, event, point, prevPoint,
|
||||||
var target = obj,
|
stopItem) {
|
||||||
stopped = false,
|
var stopped = false,
|
||||||
mouseEvent;
|
mouseEvent;
|
||||||
|
|
||||||
function emit(obj, type) {
|
function emit(obj, type) {
|
||||||
if (obj.responds(type)) {
|
if (obj.responds(type)) {
|
||||||
if (!mouseEvent) {
|
if (!mouseEvent) {
|
||||||
mouseEvent = new MouseEvent(type, event, point, target,
|
mouseEvent = new MouseEvent(type, event, point,
|
||||||
|
target || obj,
|
||||||
prevPoint ? point.subtract(prevPoint) : null);
|
prevPoint ? point.subtract(prevPoint) : null);
|
||||||
}
|
}
|
||||||
if (obj.emit(type, mouseEvent)) {
|
if (obj.emit(type, mouseEvent)) {
|
||||||
|
@ -12125,15 +12126,18 @@ new function() {
|
||||||
return stopped;
|
return stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
function emitMouseEvents(view, item, type, event, point, prevPoint) {
|
function emitMouseEvents(view, hitItem, hitTest, type, event, point,
|
||||||
|
prevPoint) {
|
||||||
view._project.removeOn(type);
|
view._project.removeOn(type);
|
||||||
prevented = called = false;
|
prevented = called = false;
|
||||||
return (dragItem && emitMouseEvent(dragItem, type, event, point,
|
return (dragItem && emitMouseEvent(dragItem, null, type, event,
|
||||||
prevPoint)
|
point, prevPoint)
|
||||||
|| item && item !== dragItem && !item.isDescendant(dragItem)
|
|| hitItem && hitItem !== dragItem
|
||||||
&& emitMouseEvent(item, fallbacks[type] || type, event, point,
|
&& !hitItem.isDescendant(dragItem)
|
||||||
prevPoint, dragItem)
|
&& emitMouseEvent(hitItem, null, fallbacks[type] || type, event,
|
||||||
|| emitMouseEvent(view, type, event, point, prevPoint));
|
point, prevPoint, dragItem)
|
||||||
|
|| emitMouseEvent(view, dragItem || hitItem || hitTest, type, event,
|
||||||
|
point, prevPoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
var itemEventsMap = {
|
var itemEventsMap = {
|
||||||
|
@ -12189,51 +12193,62 @@ new function() {
|
||||||
point = this.getEventPoint(event);
|
point = this.getEventPoint(event);
|
||||||
|
|
||||||
var inView = this.getBounds().contains(point),
|
var inView = this.getBounds().contains(point),
|
||||||
hit = hitItems && inView && this._project.hitTest(point, {
|
hitItem = undefined,
|
||||||
tolerance: 0,
|
|
||||||
fill: true,
|
|
||||||
stroke: true
|
|
||||||
}),
|
|
||||||
item = hit && hit.item || null,
|
|
||||||
handle = false,
|
handle = false,
|
||||||
mouse = {};
|
mouse = {};
|
||||||
mouse[type.substr(5)] = true;
|
mouse[type.substr(5)] = true;
|
||||||
|
|
||||||
if (hitItems && item !== overItem) {
|
function hitTest() {
|
||||||
|
if (hitItem === undefined) {
|
||||||
|
var hit = inView && view._project.hitTest(point, {
|
||||||
|
tolerance: 0,
|
||||||
|
fill: true,
|
||||||
|
stroke: true
|
||||||
|
});
|
||||||
|
hitItem = hit && hit.item || null;
|
||||||
|
}
|
||||||
|
return hitItem || view;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hitItems)
|
||||||
|
hitTest();
|
||||||
|
if (hitItems && hitItem !== overItem) {
|
||||||
if (overItem) {
|
if (overItem) {
|
||||||
emitMouseEvent(overItem, 'mouseleave', event, point);
|
emitMouseEvent(overItem, null, 'mouseleave', event, point);
|
||||||
}
|
}
|
||||||
if (item) {
|
if (hitItem) {
|
||||||
emitMouseEvent(item, 'mouseenter', event, point);
|
emitMouseEvent(hitItem, null, 'mouseenter', event, point);
|
||||||
}
|
}
|
||||||
overItem = item;
|
overItem = hitItem;
|
||||||
}
|
}
|
||||||
if (wasInView ^ inView) {
|
if (wasInView ^ inView) {
|
||||||
emitMouseEvent(this, inView ? 'mouseenter' : 'mouseleave',
|
emitMouseEvent(this, null, inView ? 'mouseenter' : 'mouseleave',
|
||||||
event, point);
|
event, point);
|
||||||
overView = inView ? this : null;
|
overView = inView ? this : null;
|
||||||
handle = true;
|
handle = true;
|
||||||
}
|
}
|
||||||
if ((inView || mouse.drag) && !point.equals(lastPoint)) {
|
if ((inView || mouse.drag) && !point.equals(lastPoint)) {
|
||||||
emitMouseEvents(this, item, nativeMove ? type : 'mousemove',
|
emitMouseEvents(this, hitItem, hitTest,
|
||||||
event, point, lastPoint);
|
nativeMove ? type : 'mousemove', event,
|
||||||
|
point, lastPoint);
|
||||||
handle = true;
|
handle = true;
|
||||||
}
|
}
|
||||||
wasInView = inView;
|
wasInView = inView;
|
||||||
if (mouse.down && inView || mouse.up && downPoint) {
|
if (mouse.down && inView || mouse.up && downPoint) {
|
||||||
emitMouseEvents(this, item, type, event, point, downPoint);
|
emitMouseEvents(this, hitItem, hitTest, type, event,
|
||||||
|
point, downPoint);
|
||||||
if (mouse.down) {
|
if (mouse.down) {
|
||||||
dblClick = item === clickItem
|
dblClick = hitItem === clickItem
|
||||||
&& (Date.now() - clickTime < 300);
|
&& (Date.now() - clickTime < 300);
|
||||||
downItem = clickItem = item;
|
downItem = clickItem = hitItem;
|
||||||
dragItem = !prevented && item;
|
dragItem = !prevented && hitItem;
|
||||||
downPoint = point;
|
downPoint = point;
|
||||||
} else if (mouse.up) {
|
} else if (mouse.up) {
|
||||||
if (!prevented && item === downItem) {
|
if (!prevented && hitItem === downItem) {
|
||||||
clickTime = Date.now();
|
clickTime = Date.now();
|
||||||
emitMouseEvents(this, item,
|
emitMouseEvents(this, hitItem, hitTest,
|
||||||
dblClick ? 'doubleclick' : 'click',
|
dblClick ? 'doubleclick' : 'click', event,
|
||||||
event, point, downPoint);
|
point, downPoint);
|
||||||
dblClick = false;
|
dblClick = false;
|
||||||
}
|
}
|
||||||
downItem = dragItem = null;
|
downItem = dragItem = null;
|
||||||
|
@ -12576,14 +12591,21 @@ var MouseEvent = Event.extend({
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.event = event;
|
this.event = event;
|
||||||
this.point = point;
|
this.point = point;
|
||||||
this.target = target;
|
this._target = target;
|
||||||
this.delta = delta;
|
this.delta = delta;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getTarget: function() {
|
||||||
|
var target = this._target;
|
||||||
|
if (typeof target === 'function')
|
||||||
|
target = this._target = target();
|
||||||
|
return target;
|
||||||
|
},
|
||||||
|
|
||||||
toString: function() {
|
toString: function() {
|
||||||
return "{ type: '" + this.type
|
return "{ type: '" + this.type
|
||||||
+ "', point: " + this.point
|
+ "', point: " + this.point
|
||||||
+ ', target: ' + this.target
|
+ ', target: ' + this.getTarget()
|
||||||
+ (this.delta ? ', delta: ' + this.delta : '')
|
+ (this.delta ? ', delta: ' + this.delta : '')
|
||||||
+ ', modifiers: ' + this.getModifiers()
|
+ ', modifiers: ' + this.getModifiers()
|
||||||
+ ' }';
|
+ ' }';
|
||||||
|
|
6
dist/paper-full.min.js
vendored
6
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue