From 3078d9d546ce0b749cf75f00ac3ec8eff72a9ed4 Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Sun, 21 Sep 2025 14:40:26 +0200 Subject: [PATCH] feat(topola-egui): Highlight node index of the obstacling primitive --- crates/topola-egui/src/displayer.rs | 13 ++++++++++++- locales/en-US/main.ftl | 5 +++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/crates/topola-egui/src/displayer.rs b/crates/topola-egui/src/displayer.rs index 87cd9cc..2de8292 100644 --- a/crates/topola-egui/src/displayer.rs +++ b/crates/topola-egui/src/displayer.rs @@ -570,11 +570,22 @@ impl<'a> Displayer<'a> { .shape() .center(); + let color = if let Some(activity) = &mut self.workspace.interactor.maybe_activity() + { + if activity.obstacles().contains(&primitive) { + egui::Color32::from_rgb(255, 255, 255) + } else { + egui::Color32::from_rgb(150, 150, 150) + } + } else { + egui::Color32::from_rgb(255, 255, 255) + }; + self.painter.paint_text( pos, egui::Align2::CENTER_CENTER, &format!("{}", primitive.index()), - egui::Color32::from_rgb(200, 200, 200), + color, ); } } diff --git a/locales/en-US/main.ftl b/locales/en-US/main.ftl index 2dc2c62..6b628aa 100644 --- a/locales/en-US/main.ftl +++ b/locales/en-US/main.ftl @@ -56,8 +56,9 @@ tr-menu-route-options-presort-by-pairwise-detours = Pairwise Detours tr-menu-route-options-permutate = Permutate -## Continuously applied, so use imperfective aspect if possible, e.g. in Polish -## it should be "przeciskaj pod taśmami" instead of "przeciśnij pod taśmami". +## Continuously applied, so use frequentative or imperfective aspect +## if possible, e.g. in Polish it should be "przeciskaj pod taśmami" +## (frequentative) instead of "przeciśnij pod taśmami". tr-menu-route-options-squeeze-through-under-bends = Squeeze through under Bends tr-menu-route-options-wrap-around-bands = Wrap around Bands