From ad33ad632a65e89ecfa293af463f1d2739d91c1a Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Tue, 4 Jun 2024 13:54:11 +0200 Subject: [PATCH] solve open error handling todo --- crates/re_edit_ui/src/visual_bounds_2d.rs | 1 + crates/re_space_view_spatial/src/ui_2d.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/re_edit_ui/src/visual_bounds_2d.rs b/crates/re_edit_ui/src/visual_bounds_2d.rs index 79c987c870abc..fa3c30402dc9d 100644 --- a/crates/re_edit_ui/src/visual_bounds_2d.rs +++ b/crates/re_edit_ui/src/visual_bounds_2d.rs @@ -95,6 +95,7 @@ pub fn singleline_edit_visual_bounds_2d( ui: &mut egui::Ui, value: &mut VisualBounds2D, ) -> egui::Response { + // Not a lot of space in a single line, so edit width/height instead. let width = value.x_range.0[1] - value.x_range.0[0]; let height = value.y_range.0[1] - value.y_range.0[0]; diff --git a/crates/re_space_view_spatial/src/ui_2d.rs b/crates/re_space_view_spatial/src/ui_2d.rs index 65c999b82c4cd..d6b32128072b4 100644 --- a/crates/re_space_view_spatial/src/ui_2d.rs +++ b/crates/re_space_view_spatial/src/ui_2d.rs @@ -2,6 +2,7 @@ use egui::{emath::RectTransform, pos2, vec2, Align2, Color32, Pos2, Rect, Shape, use macaw::IsoTransform; use re_entity_db::EntityPath; +use re_log::ResultExt as _; use re_renderer::view_builder::{TargetConfiguration, ViewBuilder}; use re_space_view::controls::{DRAG_PAN2D_BUTTON, RESET_VIEW_BUTTON_TEXT, ZOOM_SCROLL_MODIFIER}; use re_types::{ @@ -43,7 +44,8 @@ fn ui_from_scene( let bounds_property = ViewProperty::from_archetype::(ctx, view_id); let bounds: blueprint_components::VisualBounds2D = bounds_property .component_or_fallback(view_class, view_state) - .unwrap_or_default(); // TODO: error? + .ok_or_log_error() + .unwrap_or_default(); let mut bounds_rect: egui::Rect = bounds.into(); // --------------------------------------------------------------------------