MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / onPointerMove

Function onPointerMove

dashboard/graph/src/GraphCanvas.tsx:377–400  ·  view source on GitHub ↗
(event: PointerEvent)

Source from the content-addressed store, hash-verified

375 }
376
377 function onPointerMove(event: PointerEvent) {
378 const drag = dragRef.current;
379 const camera = cameraRef.current;
380 if (drag.node) {
381 const world = toWorld(event.clientX, event.clientY);
382 drag.node.fx = world.x;
383 drag.node.fy = world.y;
384 simRef.current?.reheat(0.3);
385 needsRenderRef.current = true;
386 } else if (drag.panning) {
387 camera.x -= (event.clientX - drag.lastX) / camera.k;
388 camera.y -= (event.clientY - drag.lastY) / camera.k;
389 drag.lastX = event.clientX;
390 drag.lastY = event.clientY;
391 needsRenderRef.current = true;
392 } else {
393 const node = hitTest(event.clientX, event.clientY);
394 if (node !== hoverRef.current) {
395 hoverRef.current = node;
396 canvas.style.cursor = node ? "pointer" : "grab";
397 needsRenderRef.current = true;
398 }
399 }
400 }
401
402 function onPointerUp(event: PointerEvent) {
403 const drag = dragRef.current;

Callers

nothing calls this directly

Calls 3

toWorldFunction · 0.85
hitTestFunction · 0.85
reheatMethod · 0.80

Tested by

no test coverage detected