(e: KonvaEventObject<MouseEvent | TouchEvent>)
| 23 | const currentArrowId = useRef<string | null>(null); |
| 24 | |
| 25 | const handlePointerDown = (e: KonvaEventObject<MouseEvent | TouchEvent>) => { |
| 26 | if (tool !== "arrow") return; |
| 27 | |
| 28 | // Save current state before starting new drawing |
| 29 | saveToHistory(); |
| 30 | |
| 31 | isDrawing.current = true; |
| 32 | |
| 33 | const stage = e.target.getStage(); |
| 34 | const pos = stage ? getPointerPositionRelativeToStage(stage) : null; |
| 35 | if (!pos) return; |
| 36 | |
| 37 | const id = createShapeId(); |
| 38 | currentArrowId.current = id; |
| 39 | |
| 40 | addArrow({ |
| 41 | id, |
| 42 | x: pos.x, |
| 43 | y: pos.y, |
| 44 | points: [0, 0, 0, 0], |
| 45 | stroke: properties.stroke, |
| 46 | strokeWidth: properties.strokeWidth, |
| 47 | opacity: properties.opacity, |
| 48 | }); |
| 49 | }; |
| 50 | |
| 51 | const handlePointerMove = (e: KonvaEventObject<MouseEvent | TouchEvent>) => { |
| 52 | if (!isDrawing.current || tool !== "arrow") return; |
nothing calls this directly
no test coverage detected