handleGesture
Commons
stable
Processes a completed touch gesture described by a TTouchWrapper and fires the appropriate directional callback (left, right, up, down) when the swipe distance and ratio meet the threshold. Mutates the wrapper offsetX/offsetY fields in place.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- wrapperrequisTTouchWrapper
- A touch state object carrying touchstartX/Y, touchendX/Y, offsetX/Y and optional directional callbacks (left, right, up, down).
API
Valeur de retour
La valeur retournée par cet util.
- Nothing. Fires callback(s) on the wrapper when the gesture threshold is met.
Usage
Exemples
Extraits de code prêts à coller.
Detect a left swipe