diff --git a/src/layout/stack.rs b/src/layout/stack.rs index 4565657..c7b13b4 100644 --- a/src/layout/stack.rs +++ b/src/layout/stack.rs @@ -54,6 +54,8 @@ pub struct Stack /// Children with their alignment, margin, and extra `(x, y)` translation /// applied after alignment. Drawn in order — last child is on top. pub children: Vec<( Element, HAlign, VAlign, f32, f32, f32 )>, + /// When `true`, [`preferred_size`](Self::preferred_size) reports the max of + /// children's intrinsic widths and heights instead of `(max_width, tallest)`. pub fit_content: bool, } @@ -65,6 +67,7 @@ impl Stack Self { children: Vec::new(), fit_content: false } } + /// Enable [`Self::fit_content`]. pub fn fit_content( mut self ) -> Self { self.fit_content = true;