diff --git a/crates/notedeck_ui/src/lib.rs b/crates/notedeck_ui/src/lib.rs index b45c8e18..e26bc4a4 100644 --- a/crates/notedeck_ui/src/lib.rs +++ b/crates/notedeck_ui/src/lib.rs @@ -46,12 +46,16 @@ pub fn padding( } pub fn hline(ui: &egui::Ui) { + hline_with_width(ui, ui.available_rect_before_wrap().x_range()); +} + +pub fn hline_with_width(ui: &egui::Ui, range: egui::Rangef) { // pixel perfect horizontal line let rect = ui.available_rect_before_wrap(); #[allow(deprecated)] let resize_y = ui.painter().round_to_pixel(rect.top()) - 0.5; let stroke = ui.style().visuals.widgets.noninteractive.bg_stroke; - ui.painter().hline(rect.x_range(), resize_y, stroke); + ui.painter().hline(range, resize_y, stroke); } pub fn show_pointer(ui: &egui::Ui) {