MCPcopy Create free account
hub / github.com/Shitanshukumar607/Drawspace / handlePointerMove

Function handlePointerMove

hooks/DrawArrowTool.ts:51–66  ·  view source on GitHub ↗
(e: KonvaEventObject<MouseEvent | TouchEvent>)

Source from the content-addressed store, hash-verified

49 };
50
51 const handlePointerMove = (e: KonvaEventObject<MouseEvent | TouchEvent>) => {
52 if (!isDrawing.current || tool !== "arrow") return;
53
54 const stage = e.target.getStage();
55 const pos = stage ? getPointerPositionRelativeToStage(stage) : null;
56 if (!pos) return;
57
58 if (currentArrowId.current) {
59 const arrow = arrows.find((a) => a.id === currentArrowId.current);
60 if (arrow) {
61 updateArrowInStore(currentArrowId.current, {
62 points: [0, 0, pos.x - arrow.x, pos.y - arrow.y],
63 });
64 }
65 }
66 };
67
68 const handlePointerUp = () => {
69 isDrawing.current = false;

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected