pub struct LineBox {
pub height: f32,
pub baseline: f32,
pub trim_top: f32,
pub trim_bottom: f32,
}Expand description
A resolved line box: how far apart a paragraph’s baselines are, where the baseline sits in each line, and what the paragraph’s first and last lines give back at its edges. All measured down from the top of a line.
Fields§
§height: f32Baseline-to-baseline advance: the height of every line before the paragraph’s edges are trimmed.
baseline: f32Distance from the top of a line down to its baseline.
trim_top: f32What the first line gives back above its glyphs.
trim_bottom: f32What the last line gives back below its glyphs.
Implementations§
Source§impl LineBox
impl LineBox
Sourcepub fn untrimmed(height: f32, baseline: f32) -> LineBox
pub fn untrimmed(height: f32, baseline: f32) -> LineBox
A box with nothing trimmed: height apart, baseline baseline down.
Sourcepub fn block_height(self, lines: usize) -> f32
pub fn block_height(self, lines: usize) -> f32
The height of a paragraph of lines lines: every line’s advance, less
what the first line’s top and the last line’s bottom give back.
Sourcepub fn first_baseline(self) -> f32
pub fn first_baseline(self) -> f32
The first line’s baseline, measured down from the paragraph’s top.
Trait Implementations§
impl Copy for LineBox
impl StructuralPartialEq for LineBox
Auto Trait Implementations§
impl Freeze for LineBox
impl RefUnwindSafe for LineBox
impl Send for LineBox
impl Sync for LineBox
impl Unpin for LineBox
impl UnsafeUnpin for LineBox
impl UnwindSafe for LineBox
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
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.