From dff67286d7dcd959445053258a18acbb958ed09e Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Mon, 27 May 2024 15:21:37 +0200 Subject: [PATCH] Update deprecated call --- crates/re_data_ui/src/editors/mod.rs | 6 +----- crates/re_ui/src/lib.rs | 6 +----- crates/re_viewer_context/src/gpu_bridge/colormap.rs | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/crates/re_data_ui/src/editors/mod.rs b/crates/re_data_ui/src/editors/mod.rs index 4c86de8bd8f0a..f6cff7034421b 100644 --- a/crates/re_data_ui/src/editors/mod.rs +++ b/crates/re_data_ui/src/editors/mod.rs @@ -272,11 +272,7 @@ fn edit_marker_shape_ui( // workaround to force `ui.max_rect()` to reflect the content size ui.set_width(item_width); - let background_x_range = ui - .spacing() - .menu_margin - .expand_rect(ui.max_rect()) - .x_range(); + let background_x_range = (ui.max_rect() + ui.spacing().menu_margin).x_range(); let list_ui = |ui: &mut egui::Ui| { for marker in MarkerShape::ALL { diff --git a/crates/re_ui/src/lib.rs b/crates/re_ui/src/lib.rs index c54bb6c331e8b..ca98abca2ff1a 100644 --- a/crates/re_ui/src/lib.rs +++ b/crates/re_ui/src/lib.rs @@ -1307,11 +1307,7 @@ pub fn drop_down_menu( .show_ui(ui, |ui| { ui.set_min_width(min_width); - let background_x_range = ui - .spacing() - .menu_margin - .expand_rect(ui.max_rect()) - .x_range(); + let background_x_range = (ui.max_rect() + ui.spacing().menu_margin).x_range(); list_item::list_item_scope(ui, "inner_scope", |ui| { full_span::full_span_scope(ui, background_x_range, |ui| { diff --git a/crates/re_viewer_context/src/gpu_bridge/colormap.rs b/crates/re_viewer_context/src/gpu_bridge/colormap.rs index 9e70a4208bb46..b818c21afc2b6 100644 --- a/crates/re_viewer_context/src/gpu_bridge/colormap.rs +++ b/crates/re_viewer_context/src/gpu_bridge/colormap.rs @@ -91,11 +91,7 @@ pub fn colormap_dropdown_button_ui( .show_ui(ui, |ui| { ui.set_width(200.0); - let background_x_range = ui - .spacing() - .menu_margin - .expand_rect(ui.max_rect()) - .x_range(); + let background_x_range = (ui.max_rect() + ui.spacing().menu_margin).x_range(); list_item::list_item_scope(ui, "inner_scope", |ui| { full_span::full_span_scope(ui, background_x_range, content_ui);