Skip to content

Commit

Permalink
Draw nodes above edges in graph view
Browse files Browse the repository at this point in the history
  • Loading branch information
grtlr committed Jan 20, 2025
1 parent 1efce7d commit b613844
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/viewer/re_view_graph/src/ui/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,13 @@ pub fn draw_graph(
// For now we compute the entity rectangles on the fly.
let mut current_rect = egui::Rect::NOTHING;

for (_, geometries) in layout.edges() {
for geometry in geometries {
let response = draw_edge(ui, geometry, geometry.target_arrow);
current_rect = current_rect.union(response.rect);
}
}

for node in graph.nodes() {
let center = layout.get_node(&node.id()).unwrap_or(Rect::ZERO).center();

Expand Down Expand Up @@ -391,13 +398,6 @@ pub fn draw_graph(
current_rect = current_rect.union(response.rect);
}

for (_, geometries) in layout.edges() {
for geometry in geometries {
let response = draw_edge(ui, geometry, geometry.target_arrow);
current_rect = current_rect.union(response.rect);
}
}

// We only show entity rects if there are multiple entities.
// For now, these entity rects are not part of the layout, but rather tracked on the fly.
if layout.num_entities() > 1 {
Expand Down

0 comments on commit b613844

Please sign in to comment.