UNPKG

react-native-gesture-handler

Version:

Experimental implementation of a new declarative API for gesture handling in react-native

9 lines (7 loc) 244 B
export function isPointerInBounds( view: HTMLElement, { x, y }: { x: number; y: number } ): boolean { const rect: DOMRect = view.getBoundingClientRect(); return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom; }