onPointerMove method

dynamic onPointerMove(
  1. dynamic event
)

Implementation

onPointerMove(event) {
  if (event.pointerType == 'touch' && this._input != INPUT.CURSOR) {
    switch (this._input) {
      case INPUT.ONE_FINGER:

        //singleMove
        this.updateTouchEvent(event);

        this.onSinglePanMove(event, STATE2.ROTATE);
        break;

      case INPUT.ONE_FINGER_SWITCHED:
        var movement =
            this.calculatePointersDistance(this._touchCurrent[0], event) *
                this._devPxRatio;

        if (movement >= this._switchSensibility) {
          //singleMove
          this._input = INPUT.ONE_FINGER;
          this.updateTouchEvent(event);

          this.onSinglePanStart(event, 'ROTATE');
          break;
        }

        break;

      case INPUT.TWO_FINGER:

        //rotate/pan/pinchMove
        this.updateTouchEvent(event);

        this.onRotateMove();
        this.onPinchMove();
        this.onDoublePanMove();

        break;

      case INPUT.MULT_FINGER:

        //multMove
        this.updateTouchEvent(event);

        this.onTriplePanMove(event);
        break;
    }
  } else if (event.pointerType != 'touch' && this._input == INPUT.CURSOR) {
    var modifier = null;

    if (event.ctrlKey || event.metaKey) {
      modifier = 'CTRL';
    } else if (event.shiftKey) {
      modifier = 'SHIFT';
    }

    var mouseOpState = this.getOpStateFromAction(this._button, modifier);

    if (mouseOpState != null) {
      this.onSinglePanMove(event, mouseOpState);
    }
  }

  //checkDistance
  if (this._downValid) {
    var movement = this.calculatePointersDistance(
            this._downEvents[this._downEvents.length - 1], event) *
        this._devPxRatio;
    if (movement > this._movementThreshold) {
      this._downValid = false;
    }
  }
}