diff --git a/crates/viewer/re_view_graph/src/ui/draw.rs b/crates/viewer/re_view_graph/src/ui/draw.rs index a9a6b68aedc4..db9566f9778d 100644 --- a/crates/viewer/re_view_graph/src/ui/draw.rs +++ b/crates/viewer/re_view_graph/src/ui/draw.rs @@ -94,7 +94,7 @@ fn draw_circle_label( let &CircleLabel { radius, color } = label; let visuals = &ui.style().visuals.clone(); - let (resp, painter) = ui.allocate_painter(Vec2::splat(radius * 2.0), Sense::click()); + let (resp, painter) = ui.allocate_painter(Vec2::splat(radius * 2.0), Sense::hover()); painter.circle( resp.rect.center(), radius, @@ -132,13 +132,9 @@ fn draw_text_label(ui: &mut Ui, label: &TextLabel, highlight: InteractionHighlig .stroke(stroke) .fill(bg) .show(ui, |ui| { - ui.add( - egui::Label::new(galley.clone()) - .selectable(false) - .sense(Sense::click()), - ) + ui.add(egui::Label::new(galley.clone()).selectable(false)) }) - .response + .inner } /// Draws a node at the given position. @@ -148,15 +144,18 @@ fn draw_node( node: &DrawableLabel, highlight: InteractionHighlight, ) -> Response { - let builder = UiBuilder::new().max_rect(Rect::from_center_size(center, node.size())); - let mut node_ui = ui.new_child(builder); + let builder = UiBuilder::new() + .max_rect(Rect::from_center_size(center, node.size())) + .sense(Sense::click()); - // TODO(grtlr): handle highlights + let mut node_ui = ui.new_child(builder); match node { DrawableLabel::Circle(label) => draw_circle_label(&mut node_ui, label, highlight), DrawableLabel::Text(label) => draw_text_label(&mut node_ui, label, highlight), - } + }; + + node_ui.response() } /// Draws a bounding box, as well as a basic coordinate system.