mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
页边距修改
This commit is contained in:
@@ -38,7 +38,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
link.SinkConnectorInfo.MiddlePosition,
|
||||
link.IsFullConnection ? link.SinkConnectorInfoFully.Orientation : (link.SinkConnectorInfo.MiddlePosition.Y >= link.SourceConnectorInfo.MiddlePosition.Y ? ConnectorOrientation.Top : ConnectorOrientation.Bottom),
|
||||
_.GridCellSize,
|
||||
_.GridMargin);
|
||||
_.GridMarginSize);
|
||||
|
||||
middle.Insert(0, route[0]);
|
||||
middle.Add(route[1]);
|
||||
@@ -46,7 +46,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return middle.ToArray();
|
||||
}
|
||||
|
||||
private static List<PointBase> GetMiddlePoints(PointBase source, ConnectorOrientation sourceOrientation, PointBase sink, ConnectorOrientation sinkOrientation, SizeBase gridCellSize, double gridMargin)
|
||||
private static List<PointBase> GetMiddlePoints(PointBase source, ConnectorOrientation sourceOrientation, PointBase sink, ConnectorOrientation sinkOrientation, SizeBase gridCellSize, SizeBase gridMargin)
|
||||
{
|
||||
var points = new List<PointBase>();
|
||||
|
||||
@@ -56,8 +56,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
if (p0 == p1)
|
||||
return points;
|
||||
|
||||
var p2 = new PointBase(GetNearestCross(p0.X, p1.X, gridCellSize.Width, gridMargin), GetNearestCross(p0.Y, p1.Y, gridCellSize.Height, gridMargin));
|
||||
var p3 = new PointBase(GetNearestCross(p1.X, p0.X, gridCellSize.Width, gridMargin), GetNearestCross(p1.Y, p0.Y, gridCellSize.Height, gridMargin));
|
||||
var p2 = new PointBase(GetNearestCross(p0.X, p1.X, gridCellSize.Width, gridMargin.Width), GetNearestCross(p0.Y, p1.Y, gridCellSize.Height, gridMargin.Height));
|
||||
var p3 = new PointBase(GetNearestCross(p1.X, p0.X, gridCellSize.Width, gridMargin.Width), GetNearestCross(p1.Y, p0.Y, gridCellSize.Height, gridMargin.Height));
|
||||
if (p2 == p3)
|
||||
{
|
||||
points.Add(p0);
|
||||
@@ -77,10 +77,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return points;
|
||||
}
|
||||
|
||||
private static PointBase GetFirstSegment(PointBase point, ConnectorOrientation orientation, SizeBase cellSize, double margin)
|
||||
private static PointBase GetFirstSegment(PointBase point, ConnectorOrientation orientation, SizeBase cellSize, SizeBase margin)
|
||||
{
|
||||
double x = ((int)((point.X - margin) / cellSize.Width) + 0.5) * cellSize.Width + margin;
|
||||
double y = ((int)((point.Y - margin) / cellSize.Height) + 0.5) * cellSize.Height + margin;
|
||||
double x = ((int)((point.X - margin.Width) / cellSize.Width) + 0.5) * cellSize.Width + margin.Width;
|
||||
double y = ((int)((point.Y - margin.Height) / cellSize.Height) + 0.5) * cellSize.Height + margin.Height;
|
||||
if (orientation == ConnectorOrientation.Top)
|
||||
return new PointBase(x, y - 0.5 * cellSize.Height);
|
||||
else if (orientation == ConnectorOrientation.Bottom)
|
||||
|
||||
Reference in New Issue
Block a user