[WIP] Scaling
Test / Run tests (push) Successful in 14s

This commit is contained in:
2026-08-12 16:39:02 +02:00
parent 2dee3a9ae9
commit 31e1347376
22 changed files with 430 additions and 409 deletions
+9 -5
View File
@@ -6,8 +6,8 @@ using System.Windows.Shapes;
namespace PamhagenSysCtrl.Helpers.Pipeline {
public class PipeJoin : INode {
public const double SIZE = 18;
public const double POINT = 4;
public const double SIZE = 3.6;
public const double POINT = 0.8;
public double CenterX { get; set; }
public double CenterY { get; set; }
@@ -74,13 +74,17 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
Points = [..points],
Fill = Brushes.Black,
Stroke = Brushes.Black,
StrokeThickness = 2,
};
_rect.SetValue(Canvas.LeftProperty, CenterX - SIZE / 2);
_rect.SetValue(Canvas.TopProperty, CenterY - SIZE / 2);
canvas.Children.Add(_rect);
}
public void Scale(double scale) {
_rect?.RenderTransform = new ScaleTransform(scale, scale);
_rect?.StrokeThickness = 2 / scale;
_rect?.SetValue(Canvas.LeftProperty, (CenterX - SIZE / 2) * scale);
_rect?.SetValue(Canvas.TopProperty, (CenterY - SIZE / 2) * scale);
}
public bool IsInside(double x, double y) {
return Math.Abs(x - CenterX) <= SIZE / 2 && Math.Abs(y - CenterY) <= SIZE / 2;
}