Struct rbop::render::LayoutBlock
source · [−]pub struct LayoutBlock {
pub glyphs: Vec<(SizedGlyph, CalculatedPoint)>,
pub baseline: Dimension,
pub area: Area,
pub special: LayoutBlockSpecial,
}Fields
glyphs: Vec<(SizedGlyph, CalculatedPoint)>baseline: Dimensionarea: Areaspecial: LayoutBlockSpecialImplementations
sourceimpl LayoutBlock
impl LayoutBlock
pub fn empty() -> LayoutBlock
pub fn new(
glyphs: Vec<(SizedGlyph, CalculatedPoint)>,
baseline: Dimension
) -> Self
pub fn update_area(self) -> Self
sourcepub fn from_glyph(
renderer: &mut impl Renderer,
glyph: Glyph,
properties: LayoutComputationProperties
) -> LayoutBlock
pub fn from_glyph(
renderer: &mut impl Renderer,
glyph: Glyph,
properties: LayoutComputationProperties
) -> LayoutBlock
Creates a new layout block with one glyph at the origin. The baseline is the centre of this glyph.
pub fn offset(&self, dx: Dimension, dy: Dimension) -> LayoutBlock
pub fn merge_along_baseline(&self, other: &LayoutBlock) -> LayoutBlock
sourcepub fn merge_along_vertical_centre(
&self,
other: &LayoutBlock,
baseline: MergeBaseline
) -> LayoutBlock
pub fn merge_along_vertical_centre(
&self,
other: &LayoutBlock,
baseline: MergeBaseline
) -> LayoutBlock
Merges the glyphs of two layout blocks along their vertical centre.
sourcepub fn merge_in_place(
&self,
other: &LayoutBlock,
baseline: MergeBaseline
) -> LayoutBlock
pub fn merge_in_place(
&self,
other: &LayoutBlock,
baseline: MergeBaseline
) -> LayoutBlock
Merge the the glyphs of two layout blocks exactly, without moving them.
sourcepub fn move_right_of_other(&self, other: &LayoutBlock) -> LayoutBlock
pub fn move_right_of_other(&self, other: &LayoutBlock) -> LayoutBlock
Assuming that two layout blocks start at the same point, returns a clone of this block moved directly to the right of another layout block.
sourcepub fn move_below_other(&self, other: &LayoutBlock) -> LayoutBlock
pub fn move_below_other(&self, other: &LayoutBlock) -> LayoutBlock
Assuming that two layout blocks start at the same point, returns a clone of this block moved directly below another layout block.
sourcepub fn layout_horizontal(layouts: &[LayoutBlock]) -> LayoutBlock where
Self: Sized,
pub fn layout_horizontal(layouts: &[LayoutBlock]) -> LayoutBlock where
Self: Sized,
Calculates layout for a sequence of other layouts, one-after-the-other horizontally.
pub fn for_viewport(&self, viewport: Option<&Viewport>) -> Vec<ViewportGlyph>
Trait Implementations
sourceimpl Clone for LayoutBlock
impl Clone for LayoutBlock
sourcefn clone(&self) -> LayoutBlock
fn clone(&self) -> LayoutBlock
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for LayoutBlock
impl Send for LayoutBlock
impl Sync for LayoutBlock
impl Unpin for LayoutBlock
impl UnwindSafe for LayoutBlock
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more