hitTest method

  1. @override
bool hitTest(
  1. DiagramPoint point, {
  2. required double tolerance,
})
override

Picking with a caller tolerance. Closed outlines pick their interior only; stroke-like outlines widen their stroke to tolerance instead of the fixed diagramStrokeHitTolerance used by contains.

Implementation

@override
bool hitTest(DiagramPoint point, {required double tolerance}) =>
    (closed && pointInPolygon(point, points)) ||
    _nearPolyline(point, points, tolerance);