onPointerMove method

dynamic onPointerMove(
  1. dynamic event
)

Implementation

onPointerMove(event) {
  if (event.pointerType == 'touch' && _input != Input.cursor) {
    switch (_input) {
      case Input.oneFinger:

        //singleMove
        updateTouchEvent(event);

        onSinglePanMove(event, State2.rotate);
        break;

      case Input.oneFingerSwitched:
        var movement = calculatePointersDistance(_touchCurrent[0], event) * _devPxRatio;

        if (movement >= _switchSensibility) {
          //singleMove
          _input = Input.oneFinger;
          updateTouchEvent(event);

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

        break;

      case Input.twoFinger:

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

        onRotateMove();
        onPinchMove();
        onDoublePanMove();

        break;

      case Input.multiFinger:

        //multMove
        updateTouchEvent(event);

        onTriplePanMove(event);
        break;
    }
  } else if (event.pointerType != 'touch' && _input == Input.cursor) {
    String? modifier;

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

    var mouseOpState = getOpStateFromAction(_button, modifier);

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

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