acceptGesture method

  1. @override
void acceptGesture(
  1. int pointer
)
override

Called when this member wins the arena for the given pointer id.

Implementation

@override
void acceptGesture(int pointer) {
  if (_state == _ScaleState.possible) {
    _state = _ScaleState.started;
    _dispatchOnStartCallbackIfNeeded();
    if (dragStartBehavior == DragStartBehavior.start) {
      _initialFocalPoint = _currentFocalPoint!;
      _initialSpan = _currentSpan;
      _initialLine = _currentLine;
      _initialHorizontalSpan = _currentHorizontalSpan;
      _initialVerticalSpan = _currentVerticalSpan;
      if (_pointerPanZooms.isEmpty) {
        _initialPanZoomScaleFactor = 1.0;
        _initialPanZoomRotationFactor = 0.0;
      } else {
        _initialPanZoomScaleFactor = _scaleFactor / _pointerScaleFactor;
        _initialPanZoomRotationFactor = _pointerPanZooms.values.map((_PointerPanZoomData x) => x.rotation).reduce((double a, double b) => a + b);
      }
    }
  }
}