Fix flex layout cross-alignment when not filled
This commit is contained in:
parent
0a83024505
commit
d1bf3f02c7
2 changed files with 9 additions and 1 deletions
|
|
@ -77,7 +77,7 @@ where
|
|||
let max_cross = axis.cross(limits.max());
|
||||
|
||||
let mut fill_sum = 0;
|
||||
let mut cross = axis.cross(limits.min());
|
||||
let mut cross = axis.cross(limits.min()).max(axis.cross(limits.fill()));
|
||||
let mut available = axis.main(limits.max()) - total_spacing;
|
||||
|
||||
let mut nodes: Vec<Node> = Vec::with_capacity(items.len());
|
||||
|
|
|
|||
|
|
@ -44,6 +44,14 @@ impl Limits {
|
|||
self.max
|
||||
}
|
||||
|
||||
/// Returns the fill [`Size`] of the [`Limits`].
|
||||
///
|
||||
/// [`Limits`]: struct.Limits.html
|
||||
/// [`Size`]: ../struct.Size.html
|
||||
pub fn fill(&self) -> Size {
|
||||
self.fill
|
||||
}
|
||||
|
||||
/// Applies a width constraint to the current [`Limits`].
|
||||
///
|
||||
/// [`Limits`]: struct.Limits.html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue