pub struct EuvGestureConfig {
pub swipe_threshold: f64,
pub tap_slop: f64,
pub long_press_millis: f64,
pub pinch_threshold: f64,
}Expand description
Tunable thresholds for EuvGestureRecognizer.
Every field is public so a caller can tighten recognition for a carousel without affecting the default used elsewhere.
Fields§
§swipe_threshold: f64Minimum horizontal or vertical travel, in CSS pixels, before a touch is classified as a swipe instead of a tap.
tap_slop: f64Maximum travel, in CSS pixels, for a touch to still count as a tap or long press.
long_press_millis: f64Duration, in milliseconds, that turns a stationary touch into a long press.
pinch_threshold: f64Minimum relative scale change before a pinch step is reported as meaningful. Suppresses sub-percent jitter between adjacent moves.
Implementations§
Source§impl EuvGestureConfig
impl EuvGestureConfig
pub fn get_swipe_threshold(&self) -> f64
pub fn get_mut_swipe_threshold(&mut self) -> &mut f64
pub fn set_swipe_threshold(&mut self, val: f64) -> &mut Self
pub fn get_tap_slop(&self) -> f64
pub fn get_mut_tap_slop(&mut self) -> &mut f64
pub fn set_tap_slop(&mut self, val: f64) -> &mut Self
pub fn get_long_press_millis(&self) -> f64
pub fn get_mut_long_press_millis(&mut self) -> &mut f64
pub fn set_long_press_millis(&mut self, val: f64) -> &mut Self
pub fn get_pinch_threshold(&self) -> f64
pub fn get_mut_pinch_threshold(&mut self) -> &mut f64
pub fn set_pinch_threshold(&mut self, val: f64) -> &mut Self
Trait Implementations§
Source§impl Clone for EuvGestureConfig
impl Clone for EuvGestureConfig
impl Copy for EuvGestureConfig
Source§impl Debug for EuvGestureConfig
impl Debug for EuvGestureConfig
Source§impl Default for EuvGestureConfig
impl Default for EuvGestureConfig
Source§fn default() -> Self
fn default() -> Self
Returns the default thresholds, tuned for a finger on glass.
48px is roughly the width of an adult fingertip contact patch, so a smaller travel is treated as jitter rather than intent. 500ms is the conventional long-press boundary used by both iOS and Android.
§Returns
EuvGestureConfig- The default threshold set.