MCPcopy Create free account
hub / github.com/TheOrcDev/github-creature / handleMouseMove

Function handleMouseMove

components/light-pillar.tsx:247–260  ·  view source on GitHub ↗
(event: MouseEvent)

Source from the content-addressed store, hash-verified

245 // Mouse interaction - throttled for performance
246 let mouseMoveTimeout: number | null = null;
247 const handleMouseMove = (event: MouseEvent) => {
248 if (!interactive) return;
249
250 if (mouseMoveTimeout) return;
251
252 mouseMoveTimeout = window.setTimeout(() => {
253 mouseMoveTimeout = null;
254 }, 16); // ~60fps throttle
255
256 const rect = container.getBoundingClientRect();
257 const x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
258 const y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
259 mouseRef.current.set(x, y);
260 };
261
262 if (interactive) {
263 container.addEventListener("mousemove", handleMouseMove, {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected