pub struct TextBlockMetrics {
pub line_count: usize,
pub visible_lines: usize,
pub hidden_lines: usize,
pub required_height: f32,
pub height: f32,
pub width: f32,
}Expand description
Line-slot measurements, before rectangle/scissor clipping and without shadows. Unlike tight ink bounds, height reserves a full line advance for the last line.
Fields§
§line_count: usizeWrapped lines before applying the maximum-line policy.
visible_lines: usizeLines retained by the policy, including empty lines.
Whole lines excluded by the policy; does not count an ellipsized tail or lines subsequently clipped by the painter’s rectangle/scissor.
required_height: f32Height needed for every line: line_count * line_height.
height: f32Height of retained lines: visible_lines * line_height.
width: f32Largest retained line advance, including any ellipsis.
Implementations§
Source§impl TextBlockMetrics
impl TextBlockMetrics
Sourcepub fn is_truncated(self) -> bool
pub fn is_truncated(self) -> bool
Whether the line policy omitted copy, even when a tiny width cannot show an ellipsis. Geometric clipping is independent of this result.
Trait Implementations§
Source§impl Clone for TextBlockMetrics
impl Clone for TextBlockMetrics
Source§fn clone(&self) -> TextBlockMetrics
fn clone(&self) -> TextBlockMetrics
Returns a duplicate of the value. Read more
1.0.0 · 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 TextBlockMetrics
impl Debug for TextBlockMetrics
Source§impl Default for TextBlockMetrics
impl Default for TextBlockMetrics
Source§fn default() -> TextBlockMetrics
fn default() -> TextBlockMetrics
Returns the “default value” for a type. Read more
Source§impl PartialEq for TextBlockMetrics
impl PartialEq for TextBlockMetrics
impl Copy for TextBlockMetrics
impl StructuralPartialEq for TextBlockMetrics
Auto Trait Implementations§
impl Freeze for TextBlockMetrics
impl RefUnwindSafe for TextBlockMetrics
impl Send for TextBlockMetrics
impl Sync for TextBlockMetrics
impl Unpin for TextBlockMetrics
impl UnwindSafe for TextBlockMetrics
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