pub struct TextMeasurement {
pub size: Size,
pub line_height: f32,
pub first_baseline: f32,
pub line_count: usize,
}Expand description
What a string occupies once laid out — the answer
DrawScope::measure_text gives, and
exactly the box draw_text fills.
Fields§
§size: SizeTight block size: the widest line by its total advance, and
line_count * line_height tall.
line_height: f32Baseline-to-baseline distance.
first_baseline: f32Distance from the top of the block down to the first line’s baseline.
Subtract it from a baseline y to get the top-left a _at draw wants.
line_count: usizeNumber of laid-out lines. 1 for an empty string.
Implementations§
Trait Implementations§
Source§impl Clone for TextMeasurement
impl Clone for TextMeasurement
Source§fn clone(&self) -> TextMeasurement
fn clone(&self) -> TextMeasurement
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 moreimpl Copy for TextMeasurement
Source§impl Debug for TextMeasurement
impl Debug for TextMeasurement
Source§impl PartialEq for TextMeasurement
impl PartialEq for TextMeasurement
impl StructuralPartialEq for TextMeasurement
Auto Trait Implementations§
impl Freeze for TextMeasurement
impl RefUnwindSafe for TextMeasurement
impl Send for TextMeasurement
impl Sync for TextMeasurement
impl Unpin for TextMeasurement
impl UnsafeUnpin for TextMeasurement
impl UnwindSafe for TextMeasurement
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