Fix a regression in tool event handling.

If a tool has no mousedrag event, fall back on mousemove again.
This commit is contained in:
Jürg Lehni 2016-01-13 16:37:49 +01:00
parent d7a88d0ef3
commit 799beabf69

View file

@ -330,7 +330,8 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
// Update global reference to this scope.
paper = this._scope;
// Now handle event callbacks
var called = false, drag = false;
var called = false,
drag = false;
switch (type) {
case 'mousedown':
this._updateEvent(type, point, null, null, true, false, false);
@ -352,8 +353,12 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
this._firstMove = true;
break;
case 'mousedrag':
drag = true;
// Fall through to share event handling
// If there is no mousedrag event installed, fall back to mousemove,
// with which we share the actual event handling code anyhow.
if (!(drag = this.responds(type)))
type = 'mousemove';
// Fall through to the shared event handling code below:
/* jshint -W086 */
case 'mousemove':
// In order for idleInterval drag events to work, we need to not
// check the first call for a change of position. Subsequent calls