pub struct DragSession {
pub kind: DragKind,
pub source: Option<DragSourceId>,
pub press: Point,
pub pointer: Point,
pub ghost_offset: Vec2,
pub hovered: Option<DragTargetId>,
pub payload_type: Option<TypeId>,
pub keyboard: bool,
}Expand description
A snapshot of an in-flight (Dragging/Dropping) session, minus the
payload itself.
Fields§
§kind: DragKindWhere the session came from.
source: Option<DragSourceId>The source that started it; None for DragKind::ExternalFiles.
press: PointThe point the source was pressed at (for an external session, the point the OS drag first entered at).
pointer: PointThe latest pointer position (DragCoordinator::update_pointer).
ghost_offset: Vec2Offset from the pointer to the ghost’s origin
(DragCoordinator::set_ghost_offset); zero until a source sets it.
hovered: Option<DragTargetId>The target currently under the pointer, if any. While Dropping it
is the drop target.
payload_type: Option<TypeId>The payload’s type, while the payload is still held — None once a
target has moved it out with DragCoordinator::take_payload.
keyboard: boolWhether this session was begun by DragCoordinator::lift rather
than DragCoordinator::begin/DragCoordinator::begin_external —
a keyboard session, with no pointer driving it.
DragCoordinator::update_pointer/DragCoordinator::resolve_hover
no-op for one; hover instead advances only through
DragCoordinator::move_to_next_target/
DragCoordinator::move_to_previous_target (see the module
docs).
Implementations§
Source§impl DragSession
impl DragSession
Sourcepub fn ghost_origin(&self) -> Point
pub fn ghost_origin(&self) -> Point
Where the ghost’s origin sits: the pointer plus the ghost offset.