MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / onPointerMove

Function onPointerMove

src/content/Animations/GhostCursor/GhostCursor.jsx:412–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410 };
411
412 const onPointerMove = e => {
413 const rect = parent.getBoundingClientRect();
414 const x = THREE.MathUtils.clamp((e.clientX - rect.left) / Math.max(1, rect.width), 0, 1);
415 const y = THREE.MathUtils.clamp(1 - (e.clientY - rect.top) / Math.max(1, rect.height), 0, 1);
416 currentMouseRef.current.set(x, y);
417 pointerActiveRef.current = true;
418 lastMoveTimeRef.current = performance.now();
419 ensureLoop();
420 };
421 const onPointerEnter = () => {
422 pointerActiveRef.current = true;
423 ensureLoop();

Callers

nothing calls this directly

Calls 1

ensureLoopFunction · 0.70

Tested by

no test coverage detected