pub struct PointerEvent {
pub phase: PointerPhase,
pub position: Point,
pub origin: Point,
pub local_position: Point,
pub local_origin: Point,
pub delta: Vector,
pub button: MouseButton,
pub modifiers: Modifiers,
pub size: Size,
}Expand description
A pointer event delivered to an element that owns pointer capture.
Positions and deltas use logical pixels. Self::position and Self::origin are relative
to the native window; Self::local_position and Self::local_origin are relative to the
captured element. Once an element receives PointerPhase::Down, it continues to receive move
events and the terminal up or cancel event even when the pointer is outside its bounds.
Fields§
§phase: PointerPhase§position: PointCurrent pointer position in logical window coordinates.
origin: PointPosition at which this capture started.
local_position: PointCurrent pointer position relative to the captured element’s top-left corner.
The value can be outside the element while pointer capture is active.
local_origin: PointCapture origin relative to the captured element’s current top-left corner.
delta: VectorMotion since the preceding captured event.
modifiers: Modifiers§size: SizeThe captured element’s laid-out size in logical pixels.
Pointer arithmetic for a slider, splitter, or custom drag surface needs the element’s own
extent, and the layout that produced it lives in the core. Delivering it with the event
keeps that geometry exact for a hosted binding instead of forcing it to re-derive a size
the core already knows. It is Size::ZERO before the event is localized to an element.
Trait Implementations§
Source§impl Clone for PointerEvent
impl Clone for PointerEvent
impl Copy for PointerEvent
Source§impl Debug for PointerEvent
impl Debug for PointerEvent
Source§impl PartialEq for PointerEvent
impl PartialEq for PointerEvent
impl StructuralPartialEq for PointerEvent
Auto Trait Implementations§
impl Forget for PointerEvent
impl Freeze for PointerEvent
impl Move for PointerEvent
impl RefUnwindSafe for PointerEvent
impl Send for PointerEvent
impl Sync for PointerEvent
impl Unpin for PointerEvent
impl UnsafeUnpin for PointerEvent
impl UnwindSafe for PointerEvent
Blanket Implementations§
impl<T> Action for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.