pub struct ChildLayoutHelper;Expand description
A collection of functions to lay a box child out with the given set of BoxConstraints.
All of the functions adhere to the ChildLayouter or ChildBaselineGetter signature.
Implementations§
Source§impl ChildLayoutHelper
impl ChildLayoutHelper
Sourcepub fn dry_layout_child(
app: &mut App,
child: AnyRenderBox,
constraints: BoxConstraints,
) -> Size
pub fn dry_layout_child( app: &mut App, child: AnyRenderBox, constraints: BoxConstraints, ) -> Size
Returns the Size that the box would have if it were to be laid out with the given
BoxConstraints.
This method calls AnyRenderBox::get_dry_layout on the given box.
This method should only be called by the parent of the provided box child as it binds parent and child together (if the child is marked as dirty, the child will also be marked as dirty).
Sourcepub fn layout_child(
app: &mut App,
child: AnyRenderBox,
constraints: BoxConstraints,
) -> Size
pub fn layout_child( app: &mut App, child: AnyRenderBox, constraints: BoxConstraints, ) -> Size
Lays out the box with the given constraints and returns its Size.
This method calls AnyRenderBox::layout on the given box with parent_uses_size set
to true to receive its Size.
Sourcepub fn get_dry_baseline(
app: &mut App,
child: AnyRenderBox,
constraints: BoxConstraints,
baseline: TextBaseline,
) -> Option<f64>
pub fn get_dry_baseline( app: &mut App, child: AnyRenderBox, constraints: BoxConstraints, baseline: TextBaseline, ) -> Option<f64>
Convenience function that calls AnyRenderBox::get_dry_baseline.
Sourcepub fn get_baseline(
app: &mut App,
child: AnyRenderBox,
constraints: BoxConstraints,
baseline: TextBaseline,
) -> Option<f64>
pub fn get_baseline( app: &mut App, child: AnyRenderBox, constraints: BoxConstraints, baseline: TextBaseline, ) -> Option<f64>
Convenience function that calls AnyRenderBox::get_distance_to_baseline.
The given child must be already laid out with constraints.