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

Function handleTouchMove

components/liquid-chrome.tsx:158–168  ·  view source on GitHub ↗
(event: TouchEvent)

Source from the content-addressed store, hash-verified

156 }
157
158 function handleTouchMove(event: TouchEvent) {
159 if (event.touches.length > 0) {
160 const touch = event.touches[0];
161 const rect = container.getBoundingClientRect();
162 const x = (touch.clientX - rect.left) / rect.width;
163 const y = 1 - (touch.clientY - rect.top) / rect.height;
164 const mouseUniform = program.uniforms.uMouse.value as Float32Array;
165 mouseUniform[0] = x;
166 mouseUniform[1] = y;
167 }
168 }
169
170 if (interactive) {
171 container.addEventListener("mousemove", handleMouseMove);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected