pub trait GesturePinchEventTrait: AsRaw<libinput_event_gesture> + Context {
// Provided methods
fn scale(&self) -> f64 { ... }
fn into_gesture_pinch_event(self) -> GesturePinchEvent
where Self: Sized { ... }
}
Expand description
Common functions for pinch gesture events
Provided Methods§
Sourcefn scale(&self) -> f64
fn scale(&self) -> f64
Return the absolute scale of a pinch gesture, the scale is the division of the current distance between the fingers and the distance at the start of the gesture.
The scale begins at 1.0, and if e.g. the fingers moved together by 50% then the scale will become 0.5, if they move twice as far apart as initially the scale becomes 2.0, etc.
For gesture events that are of type GesturePinchBeginEvent
, this function
returns 1.0.
For gesture events that are of type GesturePinchEndEvent
, this function
returns the scale value of the most recent GesturePinchUpdateEvent
event
(if any) or 1.0 otherwise.
Sourcefn into_gesture_pinch_event(self) -> GesturePinchEventwhere
Self: Sized,
fn into_gesture_pinch_event(self) -> GesturePinchEventwhere
Self: Sized,
Convert into a general GesturePinchEvent