pub struct PenSample {
pub position: Point<Pixels>,
pub pressure: f32,
pub tangential_pressure: f32,
pub tilt_x: f32,
pub tilt_y: f32,
pub twist: f32,
pub width: f32,
pub height: f32,
pub time: Option<Instant>,
}Expand description
One stylus reading, in window coordinates.
Fields§
§position: Point<Pixels>Where the tip is.
pressure: f32Tip force, 0.0..=1.0; 0 while hovering.
tangential_pressure: f32Barrel wheel or finger pressure, -1.0..=1.0; 0 when the pen has none.
tilt_x: f32Tilt toward +x (right), degrees in -90.0..=90.0.
tilt_y: f32Tilt toward +y (down), degrees in -90.0..=90.0.
twist: f32Clockwise rotation about the pen’s axis, degrees in 0.0..360.0.
width: f32Contact size in logical pixels; 0 when the hardware does not say.
height: f32Contact size in logical pixels; 0 when the hardware does not say.
time: Option<Instant>When the hardware took the reading; None when the platform does not say.
Trait Implementations§
impl Copy for PenSample
impl StructuralPartialEq for PenSample
Auto Trait Implementations§
impl Forget for PenSample
impl Freeze for PenSample
impl Move for PenSample
impl RefUnwindSafe for PenSample
impl Send for PenSample
impl Sync for PenSample
impl Unpin for PenSample
impl UnsafeUnpin for PenSample
impl UnwindSafe for PenSample
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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