pub struct ParagraphMetrics {
pub width: f32,
pub height: f32,
pub line_count: usize,
pub local_version: u64,
}Expand description
Cached metrics for one logical paragraph under one layout configuration.
Width and height are logical pixels, line_count counts shaped visual lines,
and local_version mirrors the source paragraph revision.
§Examples
use ailloli_ui_editor::layout::ParagraphMetrics;
let metrics = ParagraphMetrics { width: 80.0, height: 36.0, line_count: 2, local_version: 7 };
assert_eq!(metrics.line_count, 2);Fields§
§width: f32Maximum shaped line width in logical pixels.
height: f32Complete paragraph visual height in logical pixels.
line_count: usizeNumber of shaped visual lines, normally at least one.
local_version: u64Source paragraph revision from which these metrics were computed.
Trait Implementations§
Source§impl Clone for ParagraphMetrics
impl Clone for ParagraphMetrics
Source§fn clone(&self) -> ParagraphMetrics
fn clone(&self) -> ParagraphMetrics
Returns a copy 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 ParagraphMetrics
impl Debug for ParagraphMetrics
Source§impl PartialEq for ParagraphMetrics
impl PartialEq for ParagraphMetrics
impl Copy for ParagraphMetrics
impl StructuralPartialEq for ParagraphMetrics
Auto Trait Implementations§
impl Freeze for ParagraphMetrics
impl RefUnwindSafe for ParagraphMetrics
impl Send for ParagraphMetrics
impl Sync for ParagraphMetrics
impl Unpin for ParagraphMetrics
impl UnwindSafe for ParagraphMetrics
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