pub struct Press {
pub at: Point,
pub threshold: f64,
}Expand description
The press a gesture began with.
Fields§
§at: PointWhere it landed, in surface pixels.
threshold: f64How far it has to travel to become a drag.
Implementations§
Source§impl Press
impl Press
pub const fn new(at: Point, threshold: f64) -> Self
Sourcepub const fn from_pointer(at: Point, coarse: bool) -> Self
pub const fn from_pointer(at: Point, coarse: bool) -> Self
A press from a pointer that reports its own position precisely, or not.
Sourcepub fn is_drag(self, now: Point) -> bool
pub fn is_drag(self, now: Point) -> bool
Whether the pointer has travelled far enough for this to be a drag.
Sourcepub fn is_drag_in_world(self, moved: f64, zoom: f64) -> bool
pub fn is_drag_in_world(self, moved: f64, zoom: f64) -> bool
The same question for a pointer tracked in map coordinates, where the threshold still means screen pixels however far the view is zoomed.
Trait Implementations§
impl Copy for Press
impl StructuralPartialEq for Press
Auto Trait Implementations§
impl Freeze for Press
impl RefUnwindSafe for Press
impl Send for Press
impl Sync for Press
impl Unpin for Press
impl UnsafeUnpin for Press
impl UnwindSafe for Press
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> DependencyElement for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
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<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.