pub struct TextGeometry { /* private fields */ }Expand description
A text block’s final layout as the platform engine made it
([crate::Text::on_text_layout]), to ask where its characters are:
the engine’s own answers, not an estimate from the lines.
Offsets are UTF-16 units in the block’s own text: the empty placeholders the core adds for a span’s padding are not counted, so they match the text the app gave. Boxes are in the content box (y down, points). Rust-only: it holds the engine and lives on the engine thread.
Implementations§
Source§impl TextGeometry
impl TextGeometry
Sourcepub fn hit_test(&self, point: Point<Points>) -> TextPosition
pub fn hit_test(&self, point: Point<Points>) -> TextPosition
The caret position nearest point (content box).
Sourcepub fn caret_rect(&self, position: TextPosition) -> Option<Bounds<Points>>
pub fn caret_rect(&self, position: TextPosition) -> Option<Bounds<Points>>
The caret at position: a box of no width as high as its line.
Trait Implementations§
Source§impl Clone for TextGeometry
impl Clone for TextGeometry
Auto Trait Implementations§
impl !RefUnwindSafe for TextGeometry
impl !Send for TextGeometry
impl !Sync for TextGeometry
impl !UnwindSafe for TextGeometry
impl Forget for TextGeometry
impl Freeze for TextGeometrywhere
*const RcInner<dyn GeometryEngine> is !null: Freeze,
PhantomData<RcInner<dyn GeometryEngine>>: Freeze,
*const ArcInner<dyn Any + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Any + Send + Sync>>: Freeze,
*const ArcInner<AttributedText> is !null: Freeze,
PhantomData<ArcInner<AttributedText>>: Freeze,
*const ArcInner<[u32]> is !null: Freeze,
PhantomData<ArcInner<[u32]>>: Freeze,
impl Move for TextGeometry
impl Unpin for TextGeometry
impl UnsafeUnpin for TextGeometrywhere
*const RcInner<dyn GeometryEngine> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn GeometryEngine>>: UnsafeUnpin,
*const ArcInner<dyn Any + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Any + Send + Sync>>: UnsafeUnpin,
*const ArcInner<AttributedText> is !null: UnsafeUnpin,
PhantomData<ArcInner<AttributedText>>: UnsafeUnpin,
*const ArcInner<[u32]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[u32]>>: UnsafeUnpin,
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