pub struct FloatingContext {
pub floats: Vec<FloatBox>,
}Expand description
Manages the state of all floated elements within a Block Formatting Context.
Fields§
§floats: Vec<FloatBox>All currently positioned floats within the BFC.
Implementations§
Source§impl FloatingContext
impl FloatingContext
Sourcepub fn add_float(
&mut self,
kind: LayoutFloat,
rect: LogicalRect,
margin: EdgeSizes,
)
pub fn add_float( &mut self, kind: LayoutFloat, rect: LogicalRect, margin: EdgeSizes, )
Add a newly positioned float to the context
Sourcepub fn available_line_box_space(
&self,
main_start: f32,
main_end: f32,
bfc_cross_size: f32,
wm: LayoutWritingMode,
) -> (f32, f32)
pub fn available_line_box_space( &self, main_start: f32, main_end: f32, bfc_cross_size: f32, wm: LayoutWritingMode, ) -> (f32, f32)
Finds the available space on the cross-axis for a line box at a given main-axis range.
Returns a tuple of (cross_start_offset, cross_end_offset) relative to the
BFC content box, defining the available space for an in-flow element.
Sourcepub fn clearance_offset(
&self,
clear: LayoutClear,
current_main_offset: f32,
wm: LayoutWritingMode,
) -> f32
pub fn clearance_offset( &self, clear: LayoutClear, current_main_offset: f32, wm: LayoutWritingMode, ) -> f32
Returns the main-axis offset needed to be clear of floats of the given type.
Trait Implementations§
Source§impl Clone for FloatingContext
impl Clone for FloatingContext
Source§fn clone(&self) -> FloatingContext
fn clone(&self) -> FloatingContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FloatingContext
impl Debug for FloatingContext
Source§impl Default for FloatingContext
impl Default for FloatingContext
Source§fn default() -> FloatingContext
fn default() -> FloatingContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FloatingContext
impl RefUnwindSafe for FloatingContext
impl Send for FloatingContext
impl Sync for FloatingContext
impl Unpin for FloatingContext
impl UnwindSafe for FloatingContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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