mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-14 13:16:38 +08:00
xx
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
@@ -146,11 +147,21 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
var currentPoint = e.GetPosition(this);
|
||||
if (Math.Sqrt(Math.Pow(firstPoint.Value.X - currentPoint.X, 2) + Math.Pow(firstPoint.Value.Y - currentPoint.Y, 2)) > 5)
|
||||
{
|
||||
firstPoint = null;
|
||||
if (Info?.Children?.Count > 0)
|
||||
{
|
||||
var borders = VisualHelper.FindVisualChildren<BlockBorder>(this);
|
||||
BlockBorder innerblock = null;
|
||||
BlockDesignerItemViewModel dragObject = null;
|
||||
Point dragOffset = new Point();
|
||||
foreach (var border in borders)
|
||||
{
|
||||
var itemsContainer = VisualHelper.TryFindParent<ItemsContainer>(border);
|
||||
if (this != itemsContainer)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var point = border.TransformToAncestor(this).Transform(new Point(0, 0));
|
||||
var rect = new Rect(point.X, point.Y, border.ActualWidth, border.ActualHeight);
|
||||
if (rect.Contains(currentPoint))
|
||||
@@ -167,10 +178,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
if (canvas != null)
|
||||
{
|
||||
canvas.SourceItemsContainer = this;
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
firstPoint = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,7 +190,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
base.OnMouseUp(e);
|
||||
|
||||
firstPoint = null;
|
||||
DragObject = null;
|
||||
}
|
||||
|
||||
public ConnectorOrientation Orientation
|
||||
|
||||
Reference in New Issue
Block a user