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) -> CharIndex
pub fn char_count_excluding_newline(&self) -> CharIndex
Excludes the implicit \n after the Row, if any.
Sourcepub fn char_at(&self, desired_x: f32) -> CharIndex
pub fn char_at(&self, desired_x: f32) -> CharIndex
Closest char at the desired x coordinate in row-relative coordinates.
Returns something in the range [0, char_count_excluding_newline()].
pub fn x_offset(&self, column: CharIndex) -> f32
pub fn height(&self) -> f32
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PlacedRow
impl<'de> Deserialize<'de> for PlacedRow
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for PlacedRow
Auto Trait Implementations§
impl Freeze for PlacedRow
impl RefUnwindSafe for PlacedRow
impl Send for PlacedRow
impl Sync for PlacedRow
impl Unpin for PlacedRow
impl UnsafeUnpin for PlacedRow
impl UnwindSafe for PlacedRow
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more