Skip to content

Commit e12002b

Browse files
committed
Use a switch instead
1 parent a39c0c8 commit e12002b

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

src/input/InputPlugin.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -675,20 +675,26 @@ var InputPlugin = new Class({
675675
}
676676
}
677677

678-
if (type === CONST.MOUSE_DOWN)
678+
switch (type)
679679
{
680-
total += this.processDragDownEvent(pointer);
681-
total += this.processDownEvents(pointer);
682-
}
683-
else if (type === CONST.MOUSE_UP)
684-
{
685-
total += this.processDragUpEvent(pointer);
686-
total += this.processUpEvents(pointer);
687-
}
688-
else if (type === CONST.MOUSE_MOVE)
689-
{
690-
total += this.processDragMoveEvent(pointer);
691-
total += this.processMoveEvents(pointer);
680+
case CONST.MOUSE_DOWN:
681+
case CONST.TOUCH_START:
682+
total += this.processDragDownEvent(pointer);
683+
total += this.processDownEvents(pointer);
684+
break;
685+
686+
case CONST.MOUSE_UP:
687+
case CONST.TOUCH_END:
688+
case CONST.TOUCH_CANCEL:
689+
total += this.processDragUpEvent(pointer);
690+
total += this.processUpEvents(pointer);
691+
break;
692+
693+
case CONST.MOUSE_MOVE:
694+
case CONST.TOUCH_MOVE:
695+
total += this.processDragMoveEvent(pointer);
696+
total += this.processMoveEvents(pointer);
697+
break;
692698
}
693699

694700
if (pointersTotal < 3 || !pointer.wasTouch)

0 commit comments

Comments
 (0)