rejectByPosition method

bool rejectByPosition(
  1. Offset offset
)

Returns whether to reject the gesture based on the given pointer offset.

Implementation

bool rejectByPosition(Offset offset) {
  if (_isRejected) return false;
  if (context.rejectBehavior == TouchScaleRejectBehavior.none) return false;
  if (context.rejectBehavior == TouchScaleRejectBehavior.leave) {
    return !(_renderBox?.hitTest(BoxHitTestResult(), position: offset) ?? false);
  }

  // is TouchScaleRejectBehavior.touchSlop
  return _pointerMoveDistance.dx.abs() > kTouchSlop || _pointerMoveDistance.dy.abs() > kTouchSlop;
}