From ad52396d5c9ce5e833e57ed5dbff0ea55fbe997e Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Fri, 24 Mar 2023 09:54:34 +0100 Subject: [PATCH] Swap overlay order of selection & hover outlines This causes selected things to no longer to be overwritten by hover outlines - Fixes #1597. --- crates/re_viewer/src/misc/selection_state.rs | 4 ++-- crates/re_viewer/src/ui/view_spatial/ui.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/re_viewer/src/misc/selection_state.rs b/crates/re_viewer/src/misc/selection_state.rs index 41a644ec24f9..e98c4a0f9d1c 100644 --- a/crates/re_viewer/src/misc/selection_state.rs +++ b/crates/re_viewer/src/misc/selection_state.rs @@ -335,12 +335,12 @@ impl SelectionState { let mut next_selection_mask = || { // We don't expect to overflow u8, but if we do, don't use the "background mask". selection_mask_index = selection_mask_index.wrapping_add(1).at_least(1); - OutlineMaskPreference::some(selection_mask_index, 0) + OutlineMaskPreference::some(0, selection_mask_index) }; let mut next_hover_mask = || { // We don't expect to overflow u8, but if we do, don't use the "background mask". hover_mask_index = hover_mask_index.wrapping_add(1).at_least(1); - OutlineMaskPreference::some(0, hover_mask_index) + OutlineMaskPreference::some(hover_mask_index, 0) }; for current_selection in self.selection.iter() { diff --git a/crates/re_viewer/src/ui/view_spatial/ui.rs b/crates/re_viewer/src/ui/view_spatial/ui.rs index 831454f37a75..30f06e529252 100644 --- a/crates/re_viewer/src/ui/view_spatial/ui.rs +++ b/crates/re_viewer/src/ui/view_spatial/ui.rs @@ -644,7 +644,7 @@ pub fn outline_config(gui_ctx: &egui::Context) -> OutlineConfig { OutlineConfig { outline_radius_pixel: (gui_ctx.pixels_per_point() * 1.5).at_least(0.5), - color_layer_a: selection_outline_color, - color_layer_b: hover_outline_color, + color_layer_a: hover_outline_color, + color_layer_b: selection_outline_color, } }