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;
}