pub struct DragTrack {
pub inset: f32,
pub mirrored: bool,
}Expand description
Where a drag lands along a widget that takes one: see Widget::drag_track.
Fields§
§inset: f32How far in from each end the travel starts, in logical pixels.
mirrored: boolWhether the travel runs from the right in a right-to-left reading direction.
Implementations§
Source§impl DragTrack
impl DragTrack
Sourcepub fn fraction(self, rect: Rect, x: f32, rtl: bool) -> f32
pub fn fraction(self, rect: Rect, x: f32, rtl: bool) -> f32
Where x falls along rect’s travel, as a fraction 0..=1, for a reading
direction that is right to left when rtl.
One function, used by a drag’s start, every move and its end alike: three copies of this arithmetic would agree on every slider until one of them did not.
Trait Implementations§
impl Copy for DragTrack
impl StructuralPartialEq for DragTrack
Auto Trait Implementations§
impl Freeze for DragTrack
impl RefUnwindSafe for DragTrack
impl Send for DragTrack
impl Sync for DragTrack
impl Unpin for DragTrack
impl UnsafeUnpin for DragTrack
impl UnwindSafe for DragTrack
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