Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix graph node hover #8508

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/viewer/re_view_graph/src/ui/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion crates/viewer/re_view_graph/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
Loading