RawPinchDetector
RawPinchDetector handles finger touches on a target element to track gestures. It exposes callbacks
for when a pinch starts (onStart) and when finger movement occurs
(onPinch).
Key features
- Gesture metrics — Provides getters for the pinch center (midpoint of the two initial touches), distance (current gap between fingers), and shift (average movement of the two fingers from their start points).
- Robust multi-touch handling — Always uses the two most recently active pointers, ensuring correct behavior even when additional fingers are on the screen or one hand is already touching the device.
- Accidental pinch prevention — The pinch detection temporarily disables for 100 ms after a finger is lifted, avoiding unintended cross-hand pinches during sequential finger lifts.