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

Function updatePointerData

src/ts-default/Backgrounds/Ballpit/Ballpit.tsx:660–663  ·  view source on GitHub ↗
(data: PointerData, rect: DOMRect)

Source from the content-addressed store, hash-verified

658}
659
660function updatePointerData(data: PointerData, rect: DOMRect) {
661 data.position.set(pointerPosition.x - rect.left, pointerPosition.y - rect.top);
662 data.nPosition.set((data.position.x / rect.width) * 2 - 1, (-data.position.y / rect.height) * 2 + 1);
663}
664
665function isInside(rect: DOMRect) {
666 return (

Callers 4

onTouchStartFunction · 0.70
onTouchMoveFunction · 0.70
onPointerClickFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected