Display flow arrows when selecting a path
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user