Display flow arrows when selecting a path

This commit is contained in:
2026-07-31 14:22:00 +02:00
parent 79e8640ac0
commit 19deed4fd7
7 changed files with 178 additions and 1 deletions
+3
View File
@@ -433,9 +433,12 @@ namespace PamhagenSysCtrl.Helpers {
public void ColorPipesAdjacientToPath(Path path, Brush? color1, Brush? color2) {
var color = color1;
var flowPathOffset = 0.0;
HashSet<IEdge> visited = [];
foreach (var (edge, node) in path.Hops) {
edge.Highlight = color1;
edge.Flow = color1 == PamhagenBrushes.Green ? (edge.End == node, flowPathOffset) : null;
if (edge.Flow != null) flowPathOffset += edge.FlowLength;
visited.Add(edge);
if (node is Pump) color = color2;
TraverseSubgraph(node, visited, edgeAction: (e) => e.Highlight = color);