mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
53293ab8bd
1 changed files with 7 additions and 7 deletions
|
@ -49,24 +49,24 @@ var Tool = this.Tool = ToolHandler.extend(new function() {
|
|||
// If the event was triggered by a touch screen device,
|
||||
// prevent the default behaviour, as it will otherwise
|
||||
// scroll the page:
|
||||
var touchDevice = event && event.targetTouches;
|
||||
if (touchDevice) {
|
||||
if (event && event.targetTouches) {
|
||||
DomEvent.preventDefault(event);
|
||||
}
|
||||
var point = event && viewToArtwork(event, that._document);
|
||||
// If there is only an onMouseMove handler, call it when
|
||||
// the user is dragging
|
||||
var onlyMove = !!(!that.onMouseDrag && that.onMouseMove);
|
||||
if (dragging && !onlyMove) {
|
||||
curPoint = point || curPoint;
|
||||
if (curPoint) {
|
||||
that.onHandleEvent('mousedrag', curPoint, event);
|
||||
}
|
||||
if (that.onMouseDrag)
|
||||
that._document.redraw();
|
||||
// PORT: If there is only an onMouseMove handler, also
|
||||
// call it when the user is dragging:
|
||||
} else if (!dragging || onlyMove) {
|
||||
that.onHandleEvent('mousemove', point, event);
|
||||
}
|
||||
if (that.onMouseMove || touchDevice && that.onMouseDrag) {
|
||||
that._document.redraw();
|
||||
if (that.onMouseMove)
|
||||
that._document.redraw();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue