pub struct GestureConfig {
pub drag_slop_px: i16,
pub swipe_threshold_px: i16,
pub edge_back_width_px: i16,
pub long_press_ms: u16,
pub repeat_delay_ms: u16,
pub repeat_interval_ms: u16,
pub mouse_drag_scroll: bool,
}Expand description
引擎触摸与手势交互参数配置(替代硬编码阈值)。
Fields§
§drag_slop_px: i16拖拽移动抑制长按/点击的位移死区(默认 8px)。
swipe_threshold_px: i16四向快速滑动手势(SwipeDir)最小位移(默认 16px)。
edge_back_width_px: i16移动端左边缘右滑返回手势触发宽度与位移阈值(默认 24px)。
long_press_ms: u16长按事件触发时长(默认 500ms)。
repeat_delay_ms: u16按住自动连发首次触发延迟(默认 400ms)。
repeat_interval_ms: u16按住自动连发周期(默认 100ms)。
mouse_drag_scroll: bool是否允许非触摸指针(鼠标 / 手写笔)在空白可滚动区域按住左键拖动滚动页面(默认 false)。
- 桌面鼠标环境下默认为
false:滚动页面仅通过鼠标滚轮或滚动条,避免按住鼠标拖选/误触把整个页面拖走; - 触摸屏(
PointerKind::Touch)始终支持跟手拖拽滚动与松手惯性滚动,不受此项限制; - 若地图/白板等场景需要在桌面允许鼠标拖动画布,可显式设为
true或在画布上注册.on_drag(...)。
Implementations§
Source§impl GestureConfig
impl GestureConfig
Sourcepub const fn const_default() -> Self
pub const fn const_default() -> Self
编译期默认手势参数常量(支持 VeloxEngine::new 的 #![no_std] const fn 构造)。
Trait Implementations§
Source§impl Clone for GestureConfig
impl Clone for GestureConfig
impl Copy for GestureConfig
Source§impl Debug for GestureConfig
impl Debug for GestureConfig
Source§impl Default for GestureConfig
impl Default for GestureConfig
impl Eq for GestureConfig
Source§impl PartialEq for GestureConfig
impl PartialEq for GestureConfig
impl StructuralPartialEq for GestureConfig
Auto Trait Implementations§
impl Forget for GestureConfig
impl Freeze for GestureConfig
impl Move for GestureConfig
impl RefUnwindSafe for GestureConfig
impl Send for GestureConfig
impl Sync for GestureConfig
impl Unpin for GestureConfig
impl UnsafeUnpin for GestureConfig
impl UnwindSafe for GestureConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。