Skip to main content

ParagraphCursorExt

Trait ParagraphCursorExt 

Source
pub trait ParagraphCursorExt {
    // Required methods
    fn measured_cursor_rect(
        &self,
        text: &str,
        cursor_index: usize,
    ) -> Option<SkRect>;
    fn cursor_rect(
        &self,
        text: &str,
        cursor_index: usize,
        text_align: TextAlign,
    ) -> SkRect;
    fn cursor_index_at_point(&self, point: (f64, f64)) -> usize;
}

Required Methods§

Source

fn measured_cursor_rect( &self, text: &str, cursor_index: usize, ) -> Option<SkRect>

Area of the character at cursor_index, if there is any.

Source

fn cursor_rect( &self, text: &str, cursor_index: usize, text_align: TextAlign, ) -> SkRect

Area of the character at cursor_index.

Source

fn cursor_index_at_point(&self, point: (f64, f64)) -> usize

Cursor position at the given point.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ParagraphCursorExt for SkParagraph

Source§

fn measured_cursor_rect( &self, text: &str, cursor_index: usize, ) -> Option<SkRect>

Source§

fn cursor_rect( &self, text: &str, cursor_index: usize, text_align: TextAlign, ) -> SkRect

Source§

fn cursor_index_at_point(&self, point: (f64, f64)) -> usize

Implementors§