pub struct TouchSelectionSnapshot { /* private fields */ }Expand description
Where a touch selection’s ends are laid out this frame, and what the gesture is doing to them.
Each end is the caret line box at that end in window coordinates: zero width, one line tall, at the character boundary. An empty selection has both ends at the caret. Built only by Base; a presentation layer reads it to draw the handles and place the edit menu.
Implementations§
Source§impl TouchSelectionSnapshot
impl TouchSelectionSnapshot
Sourcepub const fn start(&self) -> Bounds<Pixels>
pub const fn start(&self) -> Bounds<Pixels>
The caret line box before the first selected character.
Sourcepub const fn end(&self) -> Bounds<Pixels>
pub const fn end(&self) -> Bounds<Pixels>
The caret line box after the last selected character.
Sourcepub const fn edge(&self, edge: SelectionEdge) -> Bounds<Pixels>
pub const fn edge(&self, edge: SelectionEdge) -> Bounds<Pixels>
The caret line box at the given end.
Sourcepub const fn is_edge_visible(&self, edge: SelectionEdge) -> bool
pub const fn is_edge_visible(&self, edge: SelectionEdge) -> bool
Whether the given end is in view. A handle is drawn only for an end that is; the menu anchors to the ends that are.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the selection is a bare caret, which gets a menu but no handles.
Sourcepub fn bounds(&self) -> Option<Bounds<Pixels>>
pub fn bounds(&self) -> Option<Bounds<Pixels>>
The smallest box holding the ends in view, for anchoring the edit
menu. None when the whole selection is scrolled away.
Whether the edit menu is open. It closes while a handle is dragged and reopens when the drag ends.
Sourcepub const fn dragging(&self) -> Option<SelectionEdge>
pub const fn dragging(&self) -> Option<SelectionEdge>
The end currently being dragged by its handle.
Trait Implementations§
Source§impl Clone for TouchSelectionSnapshot
impl Clone for TouchSelectionSnapshot
Source§fn clone(&self) -> TouchSelectionSnapshot
fn clone(&self) -> TouchSelectionSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TouchSelectionSnapshot
Source§impl Debug for TouchSelectionSnapshot
impl Debug for TouchSelectionSnapshot
Source§impl PartialEq for TouchSelectionSnapshot
impl PartialEq for TouchSelectionSnapshot
impl StructuralPartialEq for TouchSelectionSnapshot
Auto Trait Implementations§
impl Freeze for TouchSelectionSnapshot
impl RefUnwindSafe for TouchSelectionSnapshot
impl Send for TouchSelectionSnapshot
impl Sync for TouchSelectionSnapshot
impl Unpin for TouchSelectionSnapshot
impl UnsafeUnpin for TouchSelectionSnapshot
impl UnwindSafe for TouchSelectionSnapshot
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
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more