pub struct PlacedRow {
pub pos: Pos2,
pub row: Arc<Row>,
}
Fields§
§pos: Pos2
The 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
.
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_count_including_newline(&self) -> usize
pub fn char_count_including_newline(&self) -> usize
Includes 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()]
.
pub fn x_offset(&self, column: usize) -> f32
pub fn height(&self) -> f32
Trait Implementations§
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 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
Mutably borrows from an owned value. Read more