mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-08 10:16:36 +08:00
删除多余的
This commit is contained in:
@@ -5,14 +5,13 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
public class PathGeneratorResult
|
||||
{
|
||||
public PathGeneratorResult(string[] paths, double sourceMarkerAngle, PointBase sourceMarkerPosition,
|
||||
double targetMarkerAngle, PointBase targetMarkerPosition, PointBase[] route)
|
||||
double targetMarkerAngle, PointBase targetMarkerPosition)
|
||||
{
|
||||
Paths = paths;
|
||||
SourceMarkerAngle = sourceMarkerAngle;
|
||||
SourceMarkerPosition = sourceMarkerPosition;
|
||||
TargetMarkerAngle = targetMarkerAngle;
|
||||
TargetMarkerPosition = targetMarkerPosition;
|
||||
Route = route;
|
||||
}
|
||||
|
||||
public string[] Paths
|
||||
@@ -42,20 +41,5 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public PointBase[] Route
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public PointBase Last1
|
||||
{
|
||||
get => Route[Route.Length - 1];
|
||||
}
|
||||
|
||||
public PointBase Last2
|
||||
{
|
||||
get => Route[Route.Length - 2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
paths[i] = FormattableString.Invariant($"M {route[i].X} {route[i].Y} L {route[i + 1].X} {route[i + 1].Y}");
|
||||
}
|
||||
|
||||
return new PathGeneratorResult(paths, sourceAngle, route[0], targetAngle, route[route.Length - 1], route);
|
||||
return new PathGeneratorResult(paths, sourceAngle, route[0], targetAngle, route[route.Length - 1]);
|
||||
}
|
||||
|
||||
private static PointBase[] GetRouteWithMiddlePoints(IDiagramViewModel _, ConnectionViewModel link, PointBase[] route)
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
paths[i] = FormattableString.Invariant($"M {route[i].X} {route[i].Y} L {route[i + 1].X} {route[i + 1].Y}");
|
||||
}
|
||||
|
||||
return new PathGeneratorResult(paths, sourceAngle, route[0], targetAngle, route[route.Length - 1], route);
|
||||
return new PathGeneratorResult(paths, sourceAngle, route[0], targetAngle, route[route.Length - 1]);
|
||||
}
|
||||
|
||||
private const int const_margin = 20;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
DoShift(route, link);
|
||||
|
||||
var path = FormattableString.Invariant($"M {route[0].X} {route[0].Y} C {route[1].X} {route[1].Y}, {route[2].X} {route[2].Y}, {route[3].X} {route[3].Y}");
|
||||
return new PathGeneratorResult(new[] { path }, sourceAngle, route[0], targetAngle, route[route.Length - 1], route);
|
||||
return new PathGeneratorResult(new[] { path }, sourceAngle, route[0], targetAngle, route[route.Length - 1]);
|
||||
}
|
||||
|
||||
private static PathGeneratorResult CurveThroughPoints(PointBase[] route, ConnectionViewModel link)
|
||||
@@ -47,7 +47,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
|
||||
// Todo: adjust marker positions based on closest control points
|
||||
return new PathGeneratorResult(paths, sourceAngle, route[0], targetAngle, route[route.Length - 1], route);
|
||||
return new PathGeneratorResult(paths, sourceAngle, route[0], targetAngle, route[route.Length - 1]);
|
||||
}
|
||||
|
||||
private static PointBase[] GetRouteWithCurvePoints(ConnectionViewModel link, PointBase[] route)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
paths[i] = FormattableString.Invariant($"M {route[i].X} {route[i].Y} L {route[i + 1].X} {route[i + 1].Y}");
|
||||
}
|
||||
|
||||
return new PathGeneratorResult(paths, sourceAngle, route[0], targetAngle, route[route.Length - 1], route);
|
||||
return new PathGeneratorResult(paths, sourceAngle, route[0], targetAngle, route[route.Length - 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user