Implement path selection

This commit is contained in:
2026-07-14 02:26:55 +02:00
parent 23c96b9397
commit 6e49693db4
16 changed files with 132 additions and 32 deletions
+4 -2
View File
@@ -11,7 +11,9 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
public double CenterX { get; set; }
public double CenterY { get; set; }
public string Label { get; set; }
public Brush? Highlight { get; set; }
public bool IsLocked { get; set; }
public bool IsOpen => CallbackIsOpen();
public bool WantOpen => CallbackWantOpen();
public ISet<IEdge> Inputs { get; init; }
@@ -57,9 +59,9 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
canvas.Children.Add(_text);
}
public bool Update(double x, double y) {
public bool Update(double x, double y, bool down) {
var hover = Math.Sqrt(Math.Pow(CenterX - x, 2) + Math.Pow(CenterY - y, 2)) <= DIAMETER / 2;
_circle?.Fill = hover ? Brushes.LightGray : Brushes.DarkGray;
_circle?.Fill = IsLocked ? Brushes.Red : Highlight ?? (hover ? Brushes.LightGray : Brushes.DarkGray);
return hover;
}
}