From 0d240c16a5337a349b3c63a67ea4814673ca2ec5 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Wed, 15 May 2024 18:01:48 -0700 Subject: [PATCH] simplify tab underline calculation Signed-off-by: William Casarin --- src/timeline.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/timeline.rs b/src/timeline.rs index 314a7de9..4398d2c0 100644 --- a/src/timeline.rs +++ b/src/timeline.rs @@ -97,8 +97,8 @@ fn tabs_ui(ui: &mut egui::Ui) { // underline if state.is_selected() { let rect = res.rect; - let underline = rect.x_range().shrink(rect.width() / 4.0); - let underline = shrink_range_to_width(underline, get_label_width(ui, txt) * 1.15); + let underline = + shrink_range_to_width(rect.x_range(), get_label_width(ui, txt) * 1.15); let underline_y = ui.painter().round_to_pixel(rect.bottom()) - 1.5; return (underline, underline_y); }