hitTest method

  1. @override
bool hitTest(
  1. Offset position
)
override

Determine if a pointer event occurred within the widget's bounds and to check if a hit occurred on a Rive listener.

Implementation

@override
bool hitTest(Offset position) {
  if (!active) return false;

  final hit = stateMachine.hitTest(
    localToArtboard(
      position: position,
      artboardBounds: artboard.bounds,
      fit: fit,
      alignment: alignment,
      size: size,
      scaleFactor: layoutScaleFactor,
    ),
  );
  // We need to process another state machine pointer event, to account for
  // potential exit events.
  return hit || _previousHitResult != HitResult.none;
}