hitTest method

bool hitTest(
  1. DiagramPoint point, {
  2. double tolerance = 5,
})

Implementation

bool hitTest(DiagramPoint point, {double tolerance = 5}) {
  if (path.length < 2) return false;
  for (var index = 1; index < path.length; index += 1) {
    if (segmentDistance(point, path[index - 1], path[index]) <= tolerance) {
      return true;
    }
  }
  return closed && segmentDistance(point, path.last, path.first) <= tolerance;
}