Enhance flow arrows

This commit is contained in:
2026-08-03 15:54:19 +02:00
parent 19deed4fd7
commit ac45092e1d
6 changed files with 76 additions and 59 deletions
@@ -76,7 +76,7 @@ namespace PamhagenSysCtrl.Windows {
e.Flow = null;
}
foreach (var p in Graph.SelectedPaths) {
Graph.ColorPipesAdjacientToPath(p, PamhagenBrushes.Green, PamhagenBrushes.DimOrange);
Graph.ColorPipesAdjacientToPath(p, PamhagenBrushes.Green, true, PamhagenBrushes.DimOrange);
}
var hover = Graph.GetHover(pos.X, pos.Y);
if (_lastSource != null && (hover.Count > 0 || _path.Count > 0)) {
@@ -87,17 +87,16 @@ namespace PamhagenSysCtrl.Windows {
if (points.Count >= 2) {
var res = Graph.GetPath(points, (n) => n is not ISink && (n is not Valve v || !v.IsLocked));
if (res is Path path) {
Graph.ColorPipesAdjacientToPath(path, PamhagenBrushes.Green, PamhagenBrushes.DimOrange);
Graph.ColorPipesAdjacientToPath(path, PamhagenBrushes.Green, false, PamhagenBrushes.DimOrange);
}
}
} else if (_lastSource == null && hover.Count > 0 && Graph.SelectedPaths.Any(p => p.Start == hover.First())) {
var path = Graph.SelectedPaths.First(p => p.Start == hover.First());
Graph.ColorPipesAdjacientToPath(path, PamhagenBrushes.Red, null);
Graph.ColorPipesAdjacientToPath(path, PamhagenBrushes.Red, true, null);
}
if (_lastSource != null) {
foreach (var edge in _lastSource.Outputs) {
edge.Highlight = PamhagenBrushes.Green;
edge.Flow = (true, 0);
}
}
Graph.Update(hover, down);