From edf81feccc18c12cefc5f3362f0b79b30ab22b5d Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Mon, 1 Jul 2024 12:12:27 +0200 Subject: [PATCH] egui: restore highlighting selected node shapes --- src/bin/topola-egui/overlay.rs | 6 ------ src/bin/topola-egui/viewport.rs | 10 ++++------ src/bin/topola-sdl2-demo/main.rs | 2 -- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/bin/topola-egui/overlay.rs b/src/bin/topola-egui/overlay.rs index bb52265..b4ca6e3 100644 --- a/src/bin/topola-egui/overlay.rs +++ b/src/bin/topola-egui/overlay.rs @@ -67,12 +67,6 @@ impl Overlay { } NodeIndex::Compound(compound) => { match board.layout().drawing().compound_weight(compound) { - /*CompoundWeight::Zone(zone) => Zone::new( - GenericIndex::::new(compound.petgraph_index()), - board.layout(), - ) - .shape() - .into(),*/ CompoundWeight::Zone(weight) => board .layout() .zone(GenericIndex::::new(compound.petgraph_index())) diff --git a/src/bin/topola-egui/viewport.rs b/src/bin/topola-egui/viewport.rs index ad83433..f69ae48 100644 --- a/src/bin/topola-egui/viewport.rs +++ b/src/bin/topola-egui/viewport.rs @@ -100,16 +100,14 @@ impl Viewport { for primitive in board.layout().drawing().layer_primitive_nodes(i) { let shape = primitive.primitive(board.layout().drawing()).shape(); - /*let color = if shared_data.highlighteds.contains(&primitive) - || overlay - .selection() - .contains_node(board, GenericNode::Primitive(primitive)) + let color = if overlay + .selection() + .contains_node(board, GenericNode::Primitive(primitive)) { layers.highlight_colors[i] } else { layers.colors[i] - };*/ - let color = layers.colors[i]; + }; painter.paint_primitive(&shape, color); } diff --git a/src/bin/topola-sdl2-demo/main.rs b/src/bin/topola-sdl2-demo/main.rs index af74e9c..17ef496 100644 --- a/src/bin/topola-sdl2-demo/main.rs +++ b/src/bin/topola-sdl2-demo/main.rs @@ -290,7 +290,6 @@ fn render_times( RouterOrLayout::Layout(ref layout) => layout.clone(), }; - //let result = panic::catch_unwind(|| { for node in layout.drawing().layer_primitive_nodes(1) { let color = if highlighteds.contains(&node) { ColorU::new(100, 100, 255, 255) @@ -362,7 +361,6 @@ fn render_times( painter.paint_edge(from, to, color, view.zoom); } } - //}); let mut scene = SceneProxy::from_scene( canvas.into_canvas().into_scene(),