Display flow arrows when selecting a path
This commit is contained in:
@@ -13,8 +13,11 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
|
||||
public bool IsTwoWay => false;
|
||||
public bool Orientation { get; set; }
|
||||
public Brush? Highlight { get; set; }
|
||||
public (bool TowardEnd, double PathOffset)? Flow { get; set; }
|
||||
public double FlowLength => _flowArrow?.Length ?? 0;
|
||||
|
||||
private Polygon? _hopper;
|
||||
private FlowArrow? _flowArrow;
|
||||
private Line? _outer1;
|
||||
private Line? _outer2;
|
||||
private Line? _inner1;
|
||||
@@ -81,15 +84,17 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
|
||||
};
|
||||
canvas.Children.Add(_outer1);
|
||||
canvas.Children.Add(_outer2);
|
||||
canvas.Children.Add(_hopper);
|
||||
canvas.Children.Add(_inner1);
|
||||
canvas.Children.Add(_inner2);
|
||||
_flowArrow = FlowArrow.Create(canvas, _inner1!, _inner2!);
|
||||
canvas.Children.Add(_hopper);
|
||||
}
|
||||
|
||||
public void Update() {
|
||||
_inner1?.Stroke = Highlight ?? Brushes.DarkGray;
|
||||
_inner2?.Stroke = Highlight ?? Brushes.DarkGray;
|
||||
_hopper?.Fill = Highlight ?? Brushes.DarkGray;
|
||||
_flowArrow?.Update(Highlight == PamhagenBrushes.Green ? Flow : null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user