Skip to content

Commit

Permalink
simplify tab underline calculation
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed May 16, 2024
1 parent 95c526f commit 0d240c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0d240c1

Please sign in to comment.