pub struct LineMetric {
pub start_index: usize,
pub end_index: usize,
pub baseline: f32,
pub height: f32,
pub width: f32,
}Expand description
Per-line metrics returned by text measurement.
When the layout engine or hit-testing code needs to know about individual lines
of text (e.g., for cursor positioning in a multi-line text field), it calls
TextMeasurer::get_line_metrics and receives a Vec<LineMetric>.
Fields§
§start_index: usizeByte index where this line starts in the source string.
end_index: usizeByte index where this line ends in the source string (exclusive).
baseline: f32Distance from the top of the line to its alphabetic baseline, in logical pixels.
height: f32Total height of the line (ascent + descent + leading), in logical pixels.
width: f32Measured width of the line’s content, in logical pixels.
Auto Trait Implementations§
impl Freeze for LineMetric
impl RefUnwindSafe for LineMetric
impl Send for LineMetric
impl Sync for LineMetric
impl Unpin for LineMetric
impl UnsafeUnpin for LineMetric
impl UnwindSafe for LineMetric
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