pub struct LineLayout {
pub fragments: Vec<LineFragment>,
pub width: f64,
pub height: f64,
pub ascent: f64,
pub descent: f64,
pub align_dx: f64,
pub baseline_from_top: f64,
pub start_byte: usize,
pub end_byte: usize,
}Expand description
One visual line within a block.
Fields§
§fragments: Vec<LineFragment>The fragments painted on this line, left to right.
width: f64Total advance width of the line’s text.
height: f64Line-box height = max(ascent + descent) * LINE_SPACING.
ascent: f64Tallest ascent across the line’s fragments.
descent: f64Deepest descent across the line’s fragments.
align_dx: f64Alignment offset added to every fragment’s x within the text column.
baseline_from_top: f64Baseline distance measured downward from the top of the line box.
start_byte: usizeByte offset (into the block’s flattened text) of the first character on
this line, and one past the last. A soft-wrapped line’s end_byte
excludes the trailing space that was dropped at the wrap point, so a
caret byte in that gap falls between end_byte of one line and
start_byte of the next. Both are 0 for an empty block’s reserved line.
end_byte: usizeTrait Implementations§
Source§impl Clone for LineLayout
impl Clone for LineLayout
Source§fn clone(&self) -> LineLayout
fn clone(&self) -> LineLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LineLayout
impl RefUnwindSafe for LineLayout
impl Send for LineLayout
impl Sync for LineLayout
impl Unpin for LineLayout
impl UnsafeUnpin for LineLayout
impl UnwindSafe for LineLayout
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>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
Converts
&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)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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>
Converts
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>
Converts
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