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

Function handlePointerMove

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

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected