pub struct TextHit {
pub byte: usize,
pub line: u32,
}Expand description
Where a point landed in the text a keyed node drew: a byte offset and
the visual row it is on. byte is a caret position: between two
characters, past the last one at the end, and cosmic-text’s rule for
which side of a glyph the point fell on. For a node holding several
text runs the offset runs across them in tree order, the way the
access tree reads a line. line is the visual row within the
node, 0-based, counted across every run the key covers by where the
rows sit: a line row of three inline runs is one row, a run that
wrapped is as many as it wrapped to, and two runs stacked are two —
not the wrapped line within one run’s buffer, and not the ordinal role="line" node a pointer
event’s line names (that one counts rows of the editor, this one
rows of the text asked about).
Fields§
§byte: usize§line: u32Implementations§
Trait Implementations§
impl Copy for TextHit
impl Eq for TextHit
impl StructuralPartialEq for TextHit
Auto Trait Implementations§
impl Freeze for TextHit
impl RefUnwindSafe for TextHit
impl Send for TextHit
impl Sync for TextHit
impl Unpin for TextHit
impl UnsafeUnpin for TextHit
impl UnwindSafe for TextHit
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.