pub struct BlockLayout {
pub block_id: usize,
pub position: usize,
pub lines: Vec<LayoutLine>,
pub y: f32,
pub height: f32,
pub top_margin: f32,
pub bottom_margin: f32,
pub left_margin: f32,
pub right_margin: f32,
pub list_marker: Option<ShapedListMarker>,
pub base_direction: TextDirection,
pub background_color: Option<[f32; 4]>,
}Expand description
Computed layout for a single block (paragraph).
Fields§
§block_id: usize§position: usizeDocument character position of the block start.
lines: Vec<LayoutLine>Laid out lines within the block.
y: f32Top edge relative to document start (set by flow layout).
height: f32Total height: top_margin + sum(line heights) + bottom_margin.
top_margin: f32§bottom_margin: f32§left_margin: f32§right_margin: f32§list_marker: Option<ShapedListMarker>Shaped list marker (positioned to the left of the content area). None if the block is not a list item.
base_direction: TextDirectionThe paragraph’s resolved base direction — never Auto.
BlockLayoutParams::base_direction may ask for auto-detection;
this is what the bidi analysis actually settled on. Selection
painting and caret motion need the answer, not the question.
background_color: Option<[f32; 4]>Block background color (RGBA). None means transparent.
Trait Implementations§
Source§impl Clone for BlockLayout
impl Clone for BlockLayout
Source§fn clone(&self) -> BlockLayout
fn clone(&self) -> BlockLayout
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 BlockLayout
impl RefUnwindSafe for BlockLayout
impl Send for BlockLayout
impl Sync for BlockLayout
impl Unpin for BlockLayout
impl UnsafeUnpin for BlockLayout
impl UnwindSafe for BlockLayout
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