mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-02 23:26:35 +08:00
使用PointBase代替Point
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using AIStudio.Wpf.DiagramDesigner.Geometry;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public static partial class PathGenerators
|
||||
{
|
||||
public static PathGeneratorResult Straight(IDiagramViewModel _, ConnectorViewModel link, PointBase[] route, PointBase source, PointBase target)
|
||||
{
|
||||
route = ConcatRouteAndSourceAndTarget(route, source, target);
|
||||
double? sourceAngle = null;
|
||||
double? targetAngle = null;
|
||||
|
||||
sourceAngle = SourceMarkerAdjustement(route, (double)link.ColorViewModel.LeftArrowSizeStyle);
|
||||
targetAngle = TargetMarkerAdjustement(route, (double)link.ColorViewModel.RightArrowPathStyle);
|
||||
|
||||
var paths = new string[route.Length - 1];
|
||||
for (var i = 0; i < route.Length - 1; i++)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user