pub struct MultiTouchInfo {
pub device_id: TouchDeviceId,
pub num_touches: usize,
pub zoom_delta: f32,
pub rotation_delta: f32,
pub translation_delta: Point,
pub force: f32,
pub center_pos: Point,
}Expand description
Gesture aggregate for the current frame, produced when two or more
fingers are on the same device. All deltas are relative to the
previous frame’s positions — the widget just accumulates them into
its own angle / scale / translation state (see LionView for the
canonical consumer).
Fields§
§device_id: TouchDeviceIdDevice that owns these touches. Useful only when the host actually distinguishes multiple touchscreens; most apps ignore.
num_touches: usizeNumber of fingers currently down (always ≥ 2 — a single-finger
frame produces None instead of a MultiTouchInfo).
zoom_delta: f32Multiplicative zoom factor since the last frame. 1.0 means
“no pinch this frame”; 1.1 means the fingers spread by 10 %.
rotation_delta: f32Rotation in radians since the last frame. Positive = CCW in widget-local (Y-up) space, i.e. visually counter-clockwise on screen.
translation_delta: PointTranslation of the centroid since the last frame, in widget-
local pixels. Widgets that want the gesture to orbit the pinch
centre should combine this with zoom_delta / rotation_delta.
force: f32Average force across active touches, or 0.0 when the
platform doesn’t report pressure.
center_pos: PointCentroid of the active touches in app-local coordinates this frame. Widgets that want to hit-test “is the gesture over me?” compare this against their own absolute bounds.
Trait Implementations§
Source§impl Clone for MultiTouchInfo
impl Clone for MultiTouchInfo
Source§fn clone(&self) -> MultiTouchInfo
fn clone(&self) -> MultiTouchInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MultiTouchInfo
impl Debug for MultiTouchInfo
impl Copy for MultiTouchInfo
Auto Trait Implementations§
impl Freeze for MultiTouchInfo
impl RefUnwindSafe for MultiTouchInfo
impl Send for MultiTouchInfo
impl Sync for MultiTouchInfo
impl Unpin for MultiTouchInfo
impl UnsafeUnpin for MultiTouchInfo
impl UnwindSafe for MultiTouchInfo
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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