pub struct ResolvedParagraphLayout {
pub constraint_width: Option<LayoutUnit>,
pub size: LayoutSize,
pub lines: Vec<LineMetric>,
pub inline_boxes: Vec<RichTextInlineBox>,
pub clusters: Vec<ParagraphCluster>,
pub glyphs: Vec<ParagraphGlyph>,
pub caret_stops: Vec<ParagraphCaretStop>,
pub selection_boxes: Vec<ParagraphSelectionBox>,
}Expand description
Immutable, backend-neutral summary of one resolved paragraph.
The width is the exact wrapping constraint. Layout snapshots retain this result so paint, hit testing, caret/selection geometry, accessibility, and IME positioning can consume the same paragraph decision rather than derive another width from an ancestor.
Fields§
§constraint_width: Option<LayoutUnit>§size: LayoutSize§lines: Vec<LineMetric>§inline_boxes: Vec<RichTextInlineBox>§clusters: Vec<ParagraphCluster>Visual-order glyph/cluster mapping used by hit testing and selection.
glyphs: Vec<ParagraphGlyph>Shaped glyph positions mapped back to entries in clusters.
caret_stops: Vec<ParagraphCaretStop>Legal caret positions, including bidi-affinity alternatives.
selection_boxes: Vec<ParagraphSelectionBox>Atomic boxes from which arbitrary selection geometry is formed.
Implementations§
Source§impl ResolvedParagraphLayout
impl ResolvedParagraphLayout
pub fn empty(constraint_width: Option<LayoutUnit>) -> Self
Sourcepub fn hit_test(&self, point: LayoutPoint) -> usize
pub fn hit_test(&self, point: LayoutPoint) -> usize
Resolve a point to the nearest shaped cluster boundary.
Sourcepub fn caret(&self, index: usize, upstream: bool) -> Option<ParagraphCaretStop>
pub fn caret(&self, index: usize, upstream: bool) -> Option<ParagraphCaretStop>
Return the resolved caret geometry for a byte index and affinity.
Sourcepub fn selection_rects(&self, start: usize, end: usize) -> Vec<LayoutRect>
pub fn selection_rects(&self, start: usize, end: usize) -> Vec<LayoutRect>
Return visual rectangles for a logical byte range. Disjoint rectangles are preserved for bidi text; adjacent clusters on one line are merged.
Trait Implementations§
Source§impl Clone for ResolvedParagraphLayout
impl Clone for ResolvedParagraphLayout
Source§fn clone(&self) -> ResolvedParagraphLayout
fn clone(&self) -> ResolvedParagraphLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more