pub struct TextLayoutResult {
pub line_count: usize,
pub width_px: f32,
pub height_px: f32,
pub first_baseline: f32,
pub last_baseline: f32,
pub did_overflow_width: bool,
pub did_overflow_height: bool,
pub lines: Vec<TextLineInfo>,
}Expand description
Result of text layout for on_text_layout.
Fields§
§line_count: usize§width_px: f32§height_px: f32§first_baseline: f32§last_baseline: f32§did_overflow_width: bool§did_overflow_height: bool§lines: Vec<TextLineInfo>Implementations§
Source§impl TextLayoutResult
impl TextLayoutResult
pub fn get_line_start(&self, line_index: usize) -> Option<usize>
pub fn get_line_end(&self, line_index: usize) -> Option<usize>
pub fn get_line_end_visible(&self, line_index: usize) -> Option<usize>
pub fn is_line_ellipsized(&self, _line_index: usize) -> bool
pub fn get_line_top(&self, line_index: usize) -> Option<f32>
pub fn get_line_baseline(&self, line_index: usize) -> Option<f32>
pub fn get_line_bottom(&self, line_index: usize) -> Option<f32>
pub fn get_line_left(&self, line_index: usize) -> Option<f32>
pub fn get_line_right(&self, line_index: usize) -> Option<f32>
pub fn get_line_for_offset(&self, offset: usize) -> usize
pub fn get_line_for_vertical_position(&self, vertical: f32) -> usize
pub fn get_horizontal_position( &self, offset: usize, _use_primary_direction: bool, ) -> f32
pub fn has_visual_overflow(&self) -> bool
pub fn get_bounding_box(&self, offset: usize) -> Rect
pub fn get_cursor_rect(&self, offset: usize) -> Rect
pub fn get_offset_for_position(&self, position: (f32, f32)) -> Option<usize>
pub fn get_word_boundary(&self, _offset: usize) -> TextRange
pub fn get_paragraph_direction(&self, _offset: usize) -> u8
pub fn get_bidi_run_direction(&self, _offset: usize) -> u8
Trait Implementations§
Source§impl Clone for TextLayoutResult
impl Clone for TextLayoutResult
Source§fn clone(&self) -> TextLayoutResult
fn clone(&self) -> TextLayoutResult
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 moreAuto Trait Implementations§
impl Freeze for TextLayoutResult
impl RefUnwindSafe for TextLayoutResult
impl Send for TextLayoutResult
impl Sync for TextLayoutResult
impl Unpin for TextLayoutResult
impl UnsafeUnpin for TextLayoutResult
impl UnwindSafe for TextLayoutResult
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