pub struct TouchSequenceInfo {
pub(crate) state: TouchSequenceState,
active_touch_points: Vec<TouchPoint>,
handling_touch_move: bool,
pub prevent_click: bool,
pub prevent_move: TouchMoveAllowed,
pending_touch_move_actions: Vec<ScrollZoomEvent>,
hit_test_result_cache: Option<HitTestResultCache>,
}Fields§
§state: TouchSequenceStatetouch sequence state
active_touch_points: Vec<TouchPoint>touch sequence active touch points
handling_touch_move: boolThe script thread is already processing a touchmove operation.
We use this to skip sending the event to the script thread, to prevent overloading script.
prevent_click: boolDo not perform a click action.
This happens when
- We had a touch move larger than the minimum distance OR
- We had multiple active touchpoints OR
preventDefault()was called in a touch_down or touch_up handler
prevent_move: TouchMoveAllowedWhether move is allowed, prevented or the result is still pending. Once the first move has been processed by script, we can transition to non-cancellable events, and directly perform the pan without waiting for script.
pending_touch_move_actions: Vec<ScrollZoomEvent>Move operation waiting to be processed in the touch sequence.
This is only used while the first touch move is processed in script. Todo: It would be nice to merge this into the TouchSequenceState, but this requires some additional work to handle the merging of pending touch move events. Presumably if we keep a history of previous touch points, this would allow a better fling algorithm and easier merging of zoom events.
hit_test_result_cache: Option<HitTestResultCache>Cache for the last touch hit test result.
Implementations§
Source§impl TouchSequenceInfo
impl TouchSequenceInfo
fn touch_count(&self) -> usize
fn pinch_distance_and_center(&self) -> (f32, Point2D<f32, DevicePixel>)
fn add_pending_touch_move_action(&mut self, action: ScrollZoomEvent)
Sourcefn is_finished(&self) -> bool
fn is_finished(&self) -> bool
Returns true when all touch events of a sequence have been received. This does not mean that all event handlers have finished yet.
fn update_hit_test_result_cache_pointer( &mut self, delta: Vector2D<f32, DevicePixel>, )
Auto Trait Implementations§
impl Freeze for TouchSequenceInfo
impl RefUnwindSafe for TouchSequenceInfo
impl Send for TouchSequenceInfo
impl Sync for TouchSequenceInfo
impl Unpin for TouchSequenceInfo
impl UnwindSafe for TouchSequenceInfo
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more