hitTestConnection method

bool hitTestConnection({
  1. required Connection connection,
  2. required Node sourceNode,
  3. required Node targetNode,
  4. required Offset testPoint,
  5. double? tolerance,
})

Test if a point is near a connection path using cached paths for performance Returns true if the point is within the specified tolerance distance from the path

Implementation

bool hitTestConnection({
  required Connection connection,
  required Node sourceNode,
  required Node targetNode,
  required Offset testPoint,
  double? tolerance,
}) {
  // Delegate to the cache's hit testing logic
  return _pathCache.hitTest(
    connection: connection,
    sourceNode: sourceNode,
    targetNode: targetNode,
    testPoint: testPoint,
    tolerance: tolerance,
  );
}