pub struct SelectionAnchor {
pub ifc_root_node_id: NodeId,
pub cursor: TextCursor,
pub char_bounds: LogicalRect,
pub mouse_position: LogicalPosition,
}Expand description
The anchor point of a text selection - where the user started selecting.
This is the fixed point during a drag operation. It records:
- The IFC root node (where the
UnifiedLayoutlives) - The exact cursor position within that layout
- The visual bounds of the anchor character (for logical rectangle calculations)
The anchor remains constant during a drag; only the focus moves.
Fields§
§ifc_root_node_id: NodeIdThe IFC root node ID where selection started.
This is the node that has inline_layout_result (e.g., <p>, <div>).
cursor: TextCursorThe exact cursor position within the IFC’s UnifiedLayout.
char_bounds: LogicalRectVisual bounds of the anchor character in viewport coordinates. Used for computing the logical selection rectangle during multi-line/multi-node selection.
mouse_position: LogicalPositionThe mouse position when the selection started (viewport coordinates).
Trait Implementations§
Source§impl Clone for SelectionAnchor
impl Clone for SelectionAnchor
Source§fn clone(&self) -> SelectionAnchor
fn clone(&self) -> SelectionAnchor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectionAnchor
impl Debug for SelectionAnchor
Source§impl PartialEq for SelectionAnchor
impl PartialEq for SelectionAnchor
impl StructuralPartialEq for SelectionAnchor
Auto Trait Implementations§
impl Freeze for SelectionAnchor
impl RefUnwindSafe for SelectionAnchor
impl Send for SelectionAnchor
impl Sync for SelectionAnchor
impl Unpin for SelectionAnchor
impl UnwindSafe for SelectionAnchor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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