From 2f3c2a360bce6fc46e73a63c82b93f15fb7a4cb1 Mon Sep 17 00:00:00 2001 From: Barugon Date: Thu, 4 Aug 2022 03:07:45 -0700 Subject: [PATCH] Add with_main_align method (#1891) Co-authored-by: Barugon --- egui/src/layout.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/egui/src/layout.rs b/egui/src/layout.rs index 35821725..2ec0a88b 100644 --- a/egui/src/layout.rs +++ b/egui/src/layout.rs @@ -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.