(e: KonvaEventObject<MouseEvent | TouchEvent>)
| 64 | }; |
| 65 | |
| 66 | const handlePointerMove = (e: KonvaEventObject<MouseEvent | TouchEvent>) => { |
| 67 | if (tool !== "pen" && tool !== "eraser") return; |
| 68 | |
| 69 | if (!isDrawing.current) return; |
| 70 | |
| 71 | const stage = e.target.getStage(); |
| 72 | if (!stage) return; |
| 73 | |
| 74 | const point = getPointerPositionRelativeToStage(stage); |
| 75 | if (!point) return; |
| 76 | |
| 77 | updateLastLine((line) => ({ |
| 78 | ...line, |
| 79 | points: line.points.concat([point.x, point.y]), |
| 80 | })); |
| 81 | }; |
| 82 | |
| 83 | return { |
| 84 | lines, |
nothing calls this directly
no test coverage detected