hitTest method
Implementation
@override
bool hitTest(Offset point) {
if (startPoint == null || endPoint == null) return false;
const tolerance = 5.0;
final distance =
DrawingTool.distanceFromPointToLine(point, startPoint!, endPoint!);
return distance <= tolerance;
}