重新设计了创建连线时的逻辑,能够预览连接成功后的外观样式

This commit is contained in:
fengjiayi
2025-01-04 22:20:01 +08:00
parent 665a722f68
commit 702af587f9
20 changed files with 1040 additions and 277 deletions

View File

@@ -98,6 +98,7 @@ public partial class NodeContainerView : UserControl
{
IsCanvasDragging = false;
IsControlDragging = false;
nodeOperationService.ConnectingData.Reset();
}
};
#endregion
@@ -190,12 +191,11 @@ public partial class NodeContainerView : UserControl
private void NodeContainerView_PointerMoved(object? sender, PointerEventArgs e)
{
// 是否正在连接
var myData = nodeOperationService.ConnectingData;
if (myData.IsCreateing)
{
var isPass = e.JudgePointer(sender, PointerType.Mouse, p => p.IsLeftButtonPressed);
//Debug.WriteLine("canvas ispass = " + isPass);
if (isPass)
{
if (myData.Type == JunctionOfConnectionType.Invoke)
@@ -208,7 +208,9 @@ public partial class NodeContainerView : UserControl
_vm.IsConnectionArgSourceNode = true; // 正在连接节点的调用关系
}
var currentPoint = e.GetPosition(PART_NodeContainer);
//myData.CurrentJunction?.InvalidateVisual();
myData.UpdatePoint(new Point(currentPoint.X - 5, currentPoint.Y - 5));
e.Handled = true;
return;
}