Struct zng_ext_input::touch::TouchTransformInfo
source · pub struct TouchTransformInfo {
pub touches: [Point2D<f32, Px>; 2],
pub center: Point2D<f32, Px>,
pub deviation: f32,
pub deviation_x: f32,
pub deviation_y: f32,
pub angle: AngleRadian,
}
Expand description
Info useful for touch gestures computed from two touch points.
Fields§
§touches: [Point2D<f32, Px>; 2]
The two touch contact points.
center: Point2D<f32, Px>
Middle of the line between the two points.
deviation: f32
Deviation from the points to the center.
Min 1.0
deviation_x: f32
Deviation from the points.x to the center.x.
Min 1.0
deviation_y: f32
Deviation from the points.y to the center.y.
Min 1.0
angle: AngleRadian
Angle of the line.
Implementations§
source§impl TouchTransformInfo
impl TouchTransformInfo
sourcepub fn translation(&self, other: &Self) -> Vector2D<f32, Px>
pub fn translation(&self, other: &Self) -> Vector2D<f32, Px>
Computes the translation to transform from self
to other
.
sourcepub fn translation_x(&self, other: &Self) -> f32
pub fn translation_x(&self, other: &Self) -> f32
Computes the translation-x to transform from self
to other
.
sourcepub fn translation_y(&self, other: &Self) -> f32
pub fn translation_y(&self, other: &Self) -> f32
Computes the translation-y to transform from self
to other
.
sourcepub fn rotation(&self, other: &Self) -> AngleRadian
pub fn rotation(&self, other: &Self) -> AngleRadian
Computes the rotation to transform from self
to other
.
sourcepub fn scale(&self, other: &Self) -> Factor
pub fn scale(&self, other: &Self) -> Factor
Computes the scale to transform from self
to other
.
sourcepub fn scale_x(&self, other: &Self) -> Factor
pub fn scale_x(&self, other: &Self) -> Factor
Computes the scale-y to transform from self
to other
.
sourcepub fn scale_y(&self, other: &Self) -> Factor
pub fn scale_y(&self, other: &Self) -> Factor
Computes the scale-y to transform from self
to other
.
sourcepub fn transform(&self, other: &Self, mode: TouchTransformMode) -> PxTransform
pub fn transform(&self, other: &Self, mode: TouchTransformMode) -> PxTransform
Computes the transform from self
to other
.
Trait Implementations§
source§impl AddAssign<Vector2D<Px, Px>> for TouchTransformInfo
impl AddAssign<Vector2D<Px, Px>> for TouchTransformInfo
source§fn add_assign(&mut self, rhs: PxVector)
fn add_assign(&mut self, rhs: PxVector)
Performs the
+=
operation. Read moresource§impl Clone for TouchTransformInfo
impl Clone for TouchTransformInfo
source§fn clone(&self) -> TouchTransformInfo
fn clone(&self) -> TouchTransformInfo
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TouchTransformInfo
impl Debug for TouchTransformInfo
source§impl<'de> Deserialize<'de> for TouchTransformInfo
impl<'de> Deserialize<'de> for TouchTransformInfo
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for TouchTransformInfo
impl PartialEq for TouchTransformInfo
source§impl Serialize for TouchTransformInfo
impl Serialize for TouchTransformInfo
source§impl SubAssign<Vector2D<Px, Px>> for TouchTransformInfo
impl SubAssign<Vector2D<Px, Px>> for TouchTransformInfo
source§fn sub_assign(&mut self, rhs: PxVector)
fn sub_assign(&mut self, rhs: PxVector)
Performs the
-=
operation. Read moreimpl StructuralPartialEq for TouchTransformInfo
Auto Trait Implementations§
impl Freeze for TouchTransformInfo
impl RefUnwindSafe for TouchTransformInfo
impl Send for TouchTransformInfo
impl Sync for TouchTransformInfo
impl Unpin for TouchTransformInfo
impl UnwindSafe for TouchTransformInfo
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Access to mut
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
Clone the value.
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
Clone the value into a new boxed
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self
equals other
.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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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> 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>
Converts
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>
Converts
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