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 (const: unstable) · 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
Source§fn eq(&self, other: &SelectionAnchor) -> bool
fn eq(&self, other: &SelectionAnchor) -> bool
Tests for
self and other values to be equal, and is used by ==.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 UnsafeUnpin 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