pub struct SelectionUtils;Expand description
A utility class that provides useful methods for handling selection events.
Implementations§
Source§impl SelectionUtils
impl SelectionUtils
Sourcepub fn get_result_based_on_rect(
target_rect: Rect,
point: Offset,
) -> SelectionResult
pub fn get_result_based_on_rect( target_rect: Rect, point: Offset, ) -> SelectionResult
Determines a SelectionResult purely from the target rectangle.
SelectionResult::End when point is inside target_rect, SelectionResult::Previous
when it is above it in screen order, and SelectionResult::Next when below.
Sourcepub fn adjust_drag_offset(
target_rect: Rect,
point: Offset,
direction: TextDirection,
) -> Offset
pub fn adjust_drag_offset( target_rect: Rect, point: Offset, direction: TextDirection, ) -> Offset
Adjusts a dragging offset to lie within target_rect.
A point above the rect (or left of it, when at or above the bottom edge) moves to the top
leading corner; any other outside point moves to the bottom trailing corner. Leading and
trailing follow direction, as Dart’s default TextDirection.ltr does.
Auto Trait Implementations§
impl Forget for SelectionUtils
impl Freeze for SelectionUtils
impl Move for SelectionUtils
impl RefUnwindSafe for SelectionUtils
impl Send for SelectionUtils
impl Sync for SelectionUtils
impl Unpin for SelectionUtils
impl UnsafeUnpin for SelectionUtils
impl UnwindSafe for SelectionUtils
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