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

Function updatePointerData

src/ts-tailwind/Backgrounds/Ballpit/Ballpit.tsx:668–671  ·  view source on GitHub ↗
(data: PointerData, rect: DOMRect)

Source from the content-addressed store, hash-verified

666}
667
668function updatePointerData(data: PointerData, rect: DOMRect) {
669 data.position.set(pointerPosition.x - rect.left, pointerPosition.y - rect.top);
670 data.nPosition.set((data.position.x / rect.width) * 2 - 1, (-data.position.y / rect.height) * 2 + 1);
671}
672
673function isInside(rect: DOMRect) {
674 return (

Callers 4

onTouchStartFunction · 0.70
onTouchMoveFunction · 0.70
onPointerClickFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected