Merge pull request #152 from hecrj/fix/flex-layout-alignment
Fix flex layout cross-alignment when not filled
This commit is contained in:
commit
84f1a936db
@ -77,7 +77,7 @@ where
|
|||||||
let max_cross = axis.cross(limits.max());
|
let max_cross = axis.cross(limits.max());
|
||||||
|
|
||||||
let mut fill_sum = 0;
|
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 available = axis.main(limits.max()) - total_spacing;
|
||||||
|
|
||||||
let mut nodes: Vec<Node> = Vec::with_capacity(items.len());
|
let mut nodes: Vec<Node> = Vec::with_capacity(items.len());
|
||||||
|
@ -44,6 +44,14 @@ impl Limits {
|
|||||||
self.max
|
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`].
|
/// Applies a width constraint to the current [`Limits`].
|
||||||
///
|
///
|
||||||
/// [`Limits`]: struct.Limits.html
|
/// [`Limits`]: struct.Limits.html
|
||||||
|
Loading…
Reference in New Issue
Block a user