mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-08 02:06:40 +08:00
使用PointBase代替Point
This commit is contained in:
@@ -203,7 +203,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
Rect rectangleBounds = sourceConnector.TransformToVisual(this).TransformBounds(new Rect(sourceConnector.RenderSize));
|
||||
Point point = new Point(rectangleBounds.Left + (rectangleBounds.Width / 2),
|
||||
rectangleBounds.Bottom + (rectangleBounds.Height / 2));
|
||||
partialConnection = new ConnectorViewModel(_viewModel, sourceDataItem, new PartCreatedConnectionInfo(point), VectorLineDrawMode);
|
||||
partialConnection = new ConnectorViewModel(_viewModel, sourceDataItem, new PartCreatedConnectionInfo(point.X, point.Y), VectorLineDrawMode);
|
||||
|
||||
_viewModel.DirectAddItemCommand.Execute(partialConnection);
|
||||
}
|
||||
@@ -225,7 +225,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
Rect rectangleBounds = new Rect(sourceConnectorInfo.DataItem.Left, sourceConnectorInfo.DataItem.Top, 3, 3);
|
||||
Point point = new Point(rectangleBounds.Left + (rectangleBounds.Width / 2),
|
||||
rectangleBounds.Bottom + (rectangleBounds.Height / 2));
|
||||
partialConnection = new ConnectorViewModel(_viewModel, sourceConnectorInfo, new PartCreatedConnectionInfo(point), VectorLineDrawMode);
|
||||
partialConnection = new ConnectorViewModel(_viewModel, sourceConnectorInfo, new PartCreatedConnectionInfo(point.X, point.Y), VectorLineDrawMode);
|
||||
_viewModel.DirectAddItemCommand.Execute(partialConnection);
|
||||
}
|
||||
}
|
||||
@@ -309,7 +309,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
partialConnection.SinkConnectorInfo = new PartCreatedConnectionInfo(currentPoint);
|
||||
partialConnection.SinkConnectorInfo = new PartCreatedConnectionInfo(currentPoint.X, currentPoint.Y);
|
||||
HitTesting(currentPoint);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
|
||||
if (designerItem is ConnectorViewModel connector)
|
||||
{
|
||||
designerItems.Add(connector.SourceConnectorInfo.DataItem);
|
||||
if (connector.SinkConnectorInfo is FullyCreatedConnectorInfo)
|
||||
if (connector.IsFullConnection)
|
||||
{
|
||||
designerItems.Add((connector.SinkConnectorInfo as FullyCreatedConnectorInfo).DataItem);
|
||||
designerItems.Add(connector.SinkConnectorInfoFully.DataItem);
|
||||
}
|
||||
if (designerItem.OutTextItem != null)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
|
||||
|
||||
void DragThumb_DragDelta(object sender, DragDeltaEventArgs e)
|
||||
{
|
||||
if (this.DataContext is PointInfoBase point)
|
||||
if (this.DataContext is ConnectorPoint point)
|
||||
{
|
||||
double minLeft = double.MaxValue;
|
||||
double minTop = double.MaxValue;
|
||||
|
||||
Reference in New Issue
Block a user