mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-07 17:56:35 +08:00
支持添加中间节点
This commit is contained in:
@@ -33,19 +33,8 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
|
||||
{
|
||||
if (this.DataContext is ConnectorPoint point)
|
||||
{
|
||||
double minLeft = double.MaxValue;
|
||||
double minTop = double.MaxValue;
|
||||
|
||||
double left = point.X;
|
||||
double top = point.Y;
|
||||
minLeft = double.IsNaN(left) ? 0 : Math.Min(left, minLeft);
|
||||
minTop = double.IsNaN(top) ? 0 : Math.Min(top, minTop);
|
||||
|
||||
double deltaHorizontal = Math.Max(-minLeft, e.HorizontalChange);
|
||||
double deltaVertical = Math.Max(-minTop, e.VerticalChange);
|
||||
|
||||
point.X += deltaHorizontal;
|
||||
point.Y += deltaVertical;
|
||||
point.X += e.HorizontalChange;
|
||||
point.Y += e.VerticalChange;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user