From 19c429d87707610591876304b643b8fd9f25c1bf Mon Sep 17 00:00:00 2001 From: William Casarin Date: Wed, 15 May 2024 13:50:08 -0700 Subject: [PATCH] fix tab width calculation only noticed this on tabs not positioned at 0 Signed-off-by: William Casarin --- egui-tabs/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egui-tabs/src/lib.rs b/egui-tabs/src/lib.rs index 4057321..a57cd0c 100644 --- a/egui-tabs/src/lib.rs +++ b/egui-tabs/src/lib.rs @@ -191,7 +191,7 @@ impl Tabs { let mut responses = Vec::with_capacity(self.cols as usize); let mut rect = ui.available_rect_before_wrap(); - let cell_width = rect.max.x / self.cols as f32; + let cell_width = rect.width() / self.cols as f32; rect.set_width(cell_width); rect.set_height(self.height);