mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
第一版终稿
This commit is contained in:
@@ -579,7 +579,9 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
n1 = rect.BottomLeft; n2 = rect.BottomRight;
|
n1 = rect.BottomLeft; n2 = rect.BottomRight;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception("No neighour corners found!");
|
//throw new Exception("No neighour corners found!");
|
||||||
|
n1 = rect.TopLeft; n2 = rect.BottomLeft;//ToDo
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,11 +80,14 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
{
|
{
|
||||||
if (sender is FullyCreatedConnectorInfo vm)
|
if (sender is FullyCreatedConnectorInfo vm)
|
||||||
{
|
{
|
||||||
var connector = ItemContainerGenerator.ContainerFromItem(vm) as ContentPresenter;
|
if (e.PropertyName == "XRatio" || e.PropertyName == "YRatio")
|
||||||
if (connector != null)
|
|
||||||
{
|
{
|
||||||
Canvas.SetLeft(connector, vm.DataItem.GetItemWidth() * vm.XRatio - vm.ConnectorWidth / 2);
|
var connector = ItemContainerGenerator.ContainerFromItem(vm) as ContentPresenter;
|
||||||
Canvas.SetTop(connector, vm.DataItem.GetItemHeight() * vm.YRatio - vm.ConnectorHeight / 2);
|
if (connector != null)
|
||||||
|
{
|
||||||
|
Canvas.SetLeft(connector, vm.DataItem.GetItemWidth() * vm.XRatio - vm.ConnectorWidth / 2);
|
||||||
|
Canvas.SetTop(connector, vm.DataItem.GetItemHeight() * vm.YRatio - vm.ConnectorHeight / 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user