pub struct TextLayout {
pub width: f32,
pub height: f32,
pub did_exceed_max_lines: bool,
/* private fields */
}Fields§
§width: f32§height: f32§did_exceed_max_lines: boolImplementations§
Source§impl TextLayout
impl TextLayout
pub fn new( width: f32, height: f32, did_exceed_max_lines: bool, lines: Vec<TextLineMetrics>, clusters: Vec<TextCluster>, carets: Vec<(usize, TextAffinity, UiRect)>, ) -> Self
pub fn lines(&self) -> &[TextLineMetrics]
pub fn clusters(&self) -> &[TextCluster]
pub fn caret_rect(&self, index: usize) -> Option<UiRect>
pub fn caret_rect_with_affinity( &self, index: usize, affinity: TextAffinity, ) -> Option<UiRect>
pub fn selection_rects(&self, range: Range<usize>) -> Vec<UiRect>
pub fn previous_cluster_boundary(&self, index: usize) -> usize
pub fn next_cluster_boundary(&self, index: usize) -> usize
pub fn hit_test(&self, x: f32, y: f32) -> TextHit
Trait Implementations§
Source§impl Clone for TextLayout
impl Clone for TextLayout
Source§fn clone(&self) -> TextLayout
fn clone(&self) -> TextLayout
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 TextLayout
impl Debug for TextLayout
Source§impl Default for TextLayout
impl Default for TextLayout
Source§fn default() -> TextLayout
fn default() -> TextLayout
Returns the “default value” for a type. Read more
Source§impl PartialEq for TextLayout
impl PartialEq for TextLayout
impl StructuralPartialEq for TextLayout
Auto Trait Implementations§
impl Freeze for TextLayout
impl RefUnwindSafe for TextLayout
impl Send for TextLayout
impl Sync for TextLayout
impl Unpin for TextLayout
impl UnsafeUnpin for TextLayout
impl UnwindSafe for TextLayout
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