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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more