Merge remote-tracking branch 'origin/master'

This commit is contained in:
Jürg Lehni 2011-05-14 16:00:47 +01:00
commit 53293ab8bd

View file

@ -49,24 +49,24 @@ var Tool = this.Tool = ToolHandler.extend(new function() {
// If the event was triggered by a touch screen device, // If the event was triggered by a touch screen device,
// prevent the default behaviour, as it will otherwise // prevent the default behaviour, as it will otherwise
// scroll the page: // scroll the page:
var touchDevice = event && event.targetTouches; if (event && event.targetTouches) {
if (touchDevice) {
DomEvent.preventDefault(event); DomEvent.preventDefault(event);
} }
var point = event && viewToArtwork(event, that._document); 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); var onlyMove = !!(!that.onMouseDrag && that.onMouseMove);
if (dragging && !onlyMove) { if (dragging && !onlyMove) {
curPoint = point || curPoint; curPoint = point || curPoint;
if (curPoint) { if (curPoint) {
that.onHandleEvent('mousedrag', curPoint, event); 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) { } else if (!dragging || onlyMove) {
that.onHandleEvent('mousemove', point, event); that.onHandleEvent('mousemove', point, event);
} if (that.onMouseMove)
if (that.onMouseMove || touchDevice && that.onMouseDrag) { that._document.redraw();
that._document.redraw();
} }
}, },