pub struct LayoutSystem;Expand description
Drives CSS-like layout for all dirty LayoutComponent subtrees.
Each tick, dirty roots are found and dispatched to the appropriate
formatting-context algorithm (block, flex, or inline) based on
the container’s display mode. Each algorithm emits UpdateTransform
intents to position TC children.
Implementations§
Source§impl LayoutSystem
impl LayoutSystem
pub fn new() -> Self
Sourcepub fn tick(&mut self, world: &mut World, emit: &mut dyn SignalEmitter)
pub fn tick(&mut self, world: &mut World, emit: &mut dyn SignalEmitter)
Process all dirty LayoutComponent roots.
Sourcepub fn estimate_panel_width(
max_chars: usize,
text_scale: f32,
indent_width: f32,
) -> f32
pub fn estimate_panel_width( max_chars: usize, text_scale: f32, indent_width: f32, ) -> f32
Estimate the overlay-space width of a text panel without world matrices. Used during panel setup before transforms are propagated.
pub fn default_panel_width_chars() -> usize
Trait Implementations§
Source§impl Debug for LayoutSystem
impl Debug for LayoutSystem
Source§impl Default for LayoutSystem
impl Default for LayoutSystem
Source§fn default() -> LayoutSystem
fn default() -> LayoutSystem
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LayoutSystem
impl RefUnwindSafe for LayoutSystem
impl Send for LayoutSystem
impl Sync for LayoutSystem
impl Unpin for LayoutSystem
impl UnsafeUnpin for LayoutSystem
impl UnwindSafe for LayoutSystem
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> 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.