From 55534a6f7e8775bacff981bd5e12b2ceaba05a0f Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Tue, 17 Dec 2024 14:34:45 +0100 Subject: [PATCH 1/2] make graph nodes without text boxes react to hover --- crates/viewer/re_view_graph/src/ui/draw.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/viewer/re_view_graph/src/ui/draw.rs b/crates/viewer/re_view_graph/src/ui/draw.rs index 4122377be478..bc6f30e285ea 100644 --- a/crates/viewer/re_view_graph/src/ui/draw.rs +++ b/crates/viewer/re_view_graph/src/ui/draw.rs @@ -130,6 +130,13 @@ fn draw_circle_label( Color32::TRANSPARENT, Stroke::new(2.0, visuals.selection.stroke.color), ); + } else if highlight.hover == HoverHighlight::Hovered { + painter.circle( + resp.rect.center(), + radius - 2.0, + Color32::TRANSPARENT, + Stroke::new(2.0, visuals.widgets.hovered.bg_fill), + ); } resp From dd1e5e58e6ccc5101692ad3301607a3e6f334c7a Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Tue, 17 Dec 2024 14:36:28 +0100 Subject: [PATCH 2/2] fix no hover reaction on hover nodes --- crates/viewer/re_view_graph/src/view.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/viewer/re_view_graph/src/view.rs b/crates/viewer/re_view_graph/src/view.rs index 3bef101d01c3..11b08183f761 100644 --- a/crates/viewer/re_view_graph/src/view.rs +++ b/crates/viewer/re_view_graph/src/view.rs @@ -200,7 +200,9 @@ Display a graph of nodes and edges. } }); - if resp.hovered() { + // Don't set the view to hovered if something else was already hovered. + // (this can only mean that a graph node/edge was hovered) + if resp.hovered() && ctx.selection_state().hovered_items().is_empty() { ctx.selection_state().set_hovered(Item::View(query.view_id)); }