pub struct TouchTransformArgs {
pub timestamp: DInstant,
pub window_id: WindowId,
pub device_id: InputDeviceId,
pub first_info: TouchTransformInfo,
pub latest_info: TouchTransformInfo,
pub velocity: [Vector2D<Px, Px>; 2],
pub scale_factor: Factor,
pub phase: TouchPhase,
pub hits: HitTestInfo,
pub target: InteractionPath,
pub capture: Option<CaptureInfo>,
pub modifiers: ModifiersState,
/* private fields */
}Expand description
Arguments for TOUCH_TRANSFORM_EVENT.
Fields§
§timestamp: DInstantInstant the event happened.
window_id: WindowIdId of window that received the touch events.
device_id: InputDeviceIdId of the device that generated the touch events.
first_info: TouchTransformInfoInfo collected when the second touch point started.
latest_info: TouchTransformInfoLatest update of the two points.
velocity: [Vector2D<Px, Px>; 2]Velocity of the latest_info touch points.
scale_factor: FactorScale factor used in the computed pixel values.
This is the window’s scale factor when the first touch started.
phase: TouchPhaseGesture phase.
hits: HitTestInfoHit-test result for the center point between the first position of the two touches in the window when the gesture started.
target: InteractionPathFull path to the top-most hit in hits.
capture: Option<CaptureInfo>Current pointer capture.
modifiers: ModifiersStateWhat modifier keys where pressed when this event happened.
Implementations§
Source§impl TouchTransformArgs
impl TouchTransformArgs
Sourcepub fn new(
timestamp: impl Into<DInstant>,
propagation_handle: EventPropagationHandle,
window_id: impl Into<WindowId>,
device_id: impl Into<InputDeviceId>,
first_info: impl Into<TouchTransformInfo>,
latest_info: impl Into<TouchTransformInfo>,
velocity: impl Into<[Vector2D<Px, Px>; 2]>,
scale_factor: impl Into<Factor>,
phase: impl Into<TouchPhase>,
hits: impl Into<HitTestInfo>,
target: impl Into<InteractionPath>,
capture: impl Into<Option<CaptureInfo>>,
modifiers: impl Into<ModifiersState>,
) -> TouchTransformArgs
pub fn new( timestamp: impl Into<DInstant>, propagation_handle: EventPropagationHandle, window_id: impl Into<WindowId>, device_id: impl Into<InputDeviceId>, first_info: impl Into<TouchTransformInfo>, latest_info: impl Into<TouchTransformInfo>, velocity: impl Into<[Vector2D<Px, Px>; 2]>, scale_factor: impl Into<Factor>, phase: impl Into<TouchPhase>, hits: impl Into<HitTestInfo>, target: impl Into<InteractionPath>, capture: impl Into<Option<CaptureInfo>>, modifiers: impl Into<ModifiersState>, ) -> TouchTransformArgs
New args from values that convert into the argument types.
Sourcepub fn now(
window_id: impl Into<WindowId>,
device_id: impl Into<InputDeviceId>,
first_info: impl Into<TouchTransformInfo>,
latest_info: impl Into<TouchTransformInfo>,
velocity: impl Into<[Vector2D<Px, Px>; 2]>,
scale_factor: impl Into<Factor>,
phase: impl Into<TouchPhase>,
hits: impl Into<HitTestInfo>,
target: impl Into<InteractionPath>,
capture: impl Into<Option<CaptureInfo>>,
modifiers: impl Into<ModifiersState>,
) -> TouchTransformArgs
pub fn now( window_id: impl Into<WindowId>, device_id: impl Into<InputDeviceId>, first_info: impl Into<TouchTransformInfo>, latest_info: impl Into<TouchTransformInfo>, velocity: impl Into<[Vector2D<Px, Px>; 2]>, scale_factor: impl Into<Factor>, phase: impl Into<TouchPhase>, hits: impl Into<HitTestInfo>, target: impl Into<InteractionPath>, capture: impl Into<Option<CaptureInfo>>, modifiers: impl Into<ModifiersState>, ) -> TouchTransformArgs
Arguments for event that happened now (INSTANT.now).
Source§impl TouchTransformArgs
impl TouchTransformArgs
Sourcepub fn capture_allows(&self) -> bool
pub fn capture_allows(&self) -> bool
Sourcepub fn local_info(&self) -> [TouchTransformInfo; 2]
pub fn local_info(&self) -> [TouchTransformInfo; 2]
Gets the first_info and latest_info in the WIDGET inner bounds space.
Sourcepub fn translation(&self) -> Vector2D<f32, Px>
pub fn translation(&self) -> Vector2D<f32, Px>
Computes the translation to transform from first_info to latest_info.
Sourcepub fn translation_x(&self) -> f32
pub fn translation_x(&self) -> f32
Computes the translation-x to transform from first_info to latest_info.
Sourcepub fn translation_y(&self) -> f32
pub fn translation_y(&self) -> f32
Computes the translation-y to transform from first_info to latest_info.
Sourcepub fn rotation(&self) -> AngleRadian
pub fn rotation(&self) -> AngleRadian
Computes the rotation to transform from first_info to latest_info.
Sourcepub fn scale(&self) -> Factor
pub fn scale(&self) -> Factor
Computes the scale to transform from first_info to latest_info.
Sourcepub fn scale_x(&self) -> Factor
pub fn scale_x(&self) -> Factor
Computes the scale-y to transform from first_info to latest_info.
Sourcepub fn scale_y(&self) -> Factor
pub fn scale_y(&self) -> Factor
Computes the scale-y to transform from first_info to latest_info.
Sourcepub fn transform(&self, mode: TouchTransformMode) -> PxTransform
pub fn transform(&self, mode: TouchTransformMode) -> PxTransform
Computes the transform from first_info to latest_info.
Sourcepub fn local_transform(&self, mode: TouchTransformMode) -> PxTransform
pub fn local_transform(&self, mode: TouchTransformMode) -> PxTransform
Computes the transform between the local_info values, rotates and scales around the latest center.
Sourcepub fn translation_velocity(&self) -> Vector2D<Px, Px>
pub fn translation_velocity(&self) -> Vector2D<Px, Px>
Average velocity.
Sourcepub fn translation_inertia_x(&self, deceleration: Dip) -> (Px, Duration)
pub fn translation_inertia_x(&self, deceleration: Dip) -> (Px, Duration)
Compute the final offset and duration for a fling animation that simulates inertia movement from the
translation_velocity().x and deceleration. Returns 0 if velocity less than min_fling_velocity.
Deceleration is in dip/s, a good value is 1000. The recommended animation easing function
is |t| easing::ease_out(easing::quad, t).
Sourcepub fn translation_inertia_y(&self, deceleration: Dip) -> (Px, Duration)
pub fn translation_inertia_y(&self, deceleration: Dip) -> (Px, Duration)
Compute the final offset and duration for a fling animation that simulates inertia movement from the
translation_velocity().y and deceleration. Returns 0 if velocity less than min_fling_velocity.
Deceleration is in dip/s, a good value is 1000. The recommended animation easing function is
|t| easing::ease_out(easing::quad, t).
Sourcepub fn is_start(&self) -> bool
pub fn is_start(&self) -> bool
If the phase is start.
Note that the latest_info may already be different from first_info if the gesture
detector awaited to disambiguate before starting the gesture.
Trait Implementations§
Source§impl AnyEventArgs for TouchTransformArgs
impl AnyEventArgs for TouchTransformArgs
Source§fn delivery_list(&self, list: &mut UpdateDeliveryList)
fn delivery_list(&self, list: &mut UpdateDeliveryList)
Source§fn clone_any(&self) -> Box<dyn AnyEventArgs>
fn clone_any(&self) -> Box<dyn AnyEventArgs>
Source§fn propagation(&self) -> &EventPropagationHandle
fn propagation(&self) -> &EventPropagationHandle
Source§impl Clone for TouchTransformArgs
impl Clone for TouchTransformArgs
Source§fn clone(&self) -> TouchTransformArgs
fn clone(&self) -> TouchTransformArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TouchTransformArgs
impl Debug for TouchTransformArgs
Auto Trait Implementations§
impl Freeze for TouchTransformArgs
impl RefUnwindSafe for TouchTransformArgs
impl Send for TouchTransformArgs
impl Sync for TouchTransformArgs
impl Unpin for TouchTransformArgs
impl UnwindSafe for TouchTransformArgs
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§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>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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