pub struct Drag {
pub phase: DragPhase,
pub start: Point,
pub position: Point,
pub size: Size,
pub dropped: bool,
}Expand description
What Button::on_drag gets each time a drag
starts, moves or ends. Points are in the button’s own coordinates:
(0, 0) is its top-left corner, through any transform, so a slider turns
position.x / size.width into its value.
Fields§
§phase: DragPhaseWhether it starts, moves or ends.
start: PointWhere the left button went down.
position: PointWhere the pointer is now. It goes past the button’s size, and below 0, when the pointer leaves the button while dragging.
size: SizeThe button’s laid-out size.
dropped: boolAt End, whether the drag was released over a button whose
on_drop took its
drag_data. Always false before.
Trait Implementations§
impl Copy for Drag
impl StructuralPartialEq for Drag
Auto Trait Implementations§
impl Forget for Drag
impl Freeze for Drag
impl Move for Drag
impl RefUnwindSafe for Drag
impl Send for Drag
impl Sync for Drag
impl Unpin for Drag
impl UnsafeUnpin for Drag
impl UnwindSafe for Drag
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