diff --git a/crates/viewer/re_space_view_graph/src/ui/state.rs b/crates/viewer/re_space_view_graph/src/ui/state.rs index 0b317d1c865c..9d93c4e22f7c 100644 --- a/crates/viewer/re_space_view_graph/src/ui/state.rs +++ b/crates/viewer/re_space_view_graph/src/ui/state.rs @@ -91,12 +91,12 @@ pub enum LayoutState { #[default] None, InProgress { - timestamp: Discriminator, + discriminator: Discriminator, layout: Layout, provider: ForceLayout, }, Finished { - timestamp: Discriminator, + discriminator: Discriminator, layout: Layout, _provider: ForceLayout, }, @@ -132,7 +132,9 @@ impl LayoutState { ) -> Self { match self { // Layout is up to date, nothing to do here. - Self::Finished { ref timestamp, .. } if timestamp == &requested => { + Self::Finished { + ref discriminator, .. + } if discriminator == &requested => { self // no op } // We need to recompute the layout. @@ -141,34 +143,36 @@ impl LayoutState { let layout = provider.init_layout(); Self::InProgress { - timestamp: requested, + discriminator: requested, layout, provider, } } - Self::InProgress { ref timestamp, .. } if timestamp != &requested => { + Self::InProgress { + ref discriminator, .. + } if discriminator != &requested => { let provider = ForceLayout::new(graphs); let layout = provider.init_layout(); Self::InProgress { - timestamp: requested, + discriminator: requested, layout, provider, } } // We keep iterating on the layout until it is stable. Self::InProgress { - timestamp, + discriminator, mut layout, mut provider, } => match provider.tick(&mut layout) { true => Self::Finished { - timestamp, + discriminator, layout, _provider: provider, }, false => Self::InProgress { - timestamp, + discriminator, layout, provider, }, diff --git a/crates/viewer/re_space_view_graph/src/view.rs b/crates/viewer/re_space_view_graph/src/view.rs index dcf220446eb2..b3741fd4bd74 100644 --- a/crates/viewer/re_space_view_graph/src/view.rs +++ b/crates/viewer/re_space_view_graph/src/view.rs @@ -171,14 +171,14 @@ Display a graph of nodes and edges. state.world_bounds = Some(bounds); let bounds_rect: egui::Rect = bounds.into(); - let mut scene = SceneBuilder::from_world_bounds(bounds_rect); + let mut scene_builder = SceneBuilder::from_world_bounds(bounds_rect); // TODO(grtlr): Is there a blueprint archetype for debug information? if state.show_debug { - scene.show_debug(); + scene_builder.show_debug(); } - let (new_world_bounds, response) = scene.add(ui, |mut scene| { + let (new_world_bounds, response) = scene_builder.add(ui, |mut scene| { for (entity, graph) in &graphs { // We use the following to keep track of the bounding box over nodes in an entity. let mut entity_rect = egui::Rect::NOTHING;