Add with_main_align method (#1891)

Co-authored-by: Barugon <barugon@dungeonbox.net>
This commit is contained in:
Barugon 2022-08-04 03:07:45 -07:00 committed by GitHub
parent a827c3e033
commit 2f3c2a360b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -252,7 +252,13 @@ impl Layout {
Self { main_wrap, ..self }
}
/// The aligmnet to use on the cross axis.
/// The alignment to use on the main axis.
#[inline(always)]
pub fn with_main_align(self, main_align: Align) -> Self {
Self { main_align, ..self }
}
/// The alignment to use on the cross axis.
///
/// The "cross" axis is the one orthogonal to the main axis.
/// For instance: in left-to-right layout, the main axis is horizontal and the cross axis is vertical.