onTouchMove method

dynamic onTouchMove(
  1. dynamic event
)

Implementation

onTouchMove(event) {
  trackPointer(event);

  switch (_pointers.length) {
    case 1:
      _movePrev.copy(_moveCurr);
      _moveCurr.copy(getMouseOnCircle(event.pageX, event.pageY));
      break;

    default: // 2 or more

      var position = getSecondPointerPosition(event);

      var dx = event.pageX - position.x;
      var dy = event.pageY - position.y;
      _touchZoomDistanceEnd = Math.sqrt(dx * dx + dy * dy);

      var x = (event.pageX + position.x) / 2;
      var y = (event.pageY + position.y) / 2;
      _panEnd.copy(getMouseOnScreen(x, y));
      break;
  }
}