pub struct PlacedRow {
pub pos: Pos2,
pub row: Arc<Row>,
pub ends_with_newline: bool,
}Fields§
§pos: Pos2The position of this Row relative to the galley.
This is rounded to the closest pixel in order to produce crisp, pixel-perfect text.
row: Arc<Row>The underlying unpositioned Row.
ends_with_newline: boolIf true, this PlacedRow came from a paragraph ending with a \n.
The \n itself is omitted from row’s Row::glyphs.
A \n in the input text always creates a new PlacedRow below it,
so that text that ends with \n has an empty PlacedRow last.
This also implies that the last PlacedRow in a Galley always has ends_with_newline == false.
Implementations§
Source§impl PlacedRow
impl PlacedRow
Sourcepub fn rect(&self) -> Rect
pub fn rect(&self) -> Rect
Logical bounding rectangle on font heights etc.
This ignores / includes the LayoutSection::leading_space.
Sourcepub fn rect_without_leading_space(&self) -> Rect
pub fn rect_without_leading_space(&self) -> Rect
Same as Self::rect but excluding the LayoutSection::leading_space.
Methods from Deref<Target = Row>§
Sourcepub fn char_count_excluding_newline(&self) -> usize
pub fn char_count_excluding_newline(&self) -> usize
Excludes the implicit \n after the Row, if any.
Sourcepub fn char_at(&self, desired_x: f32) -> usize
pub fn char_at(&self, desired_x: f32) -> usize
Closest char at the desired x coordinate in row-relative coordinates.
Returns something in the range [0, char_count_excluding_newline()].