优化了画布平移、缩放、改变尺寸

This commit is contained in:
fengjiayi
2024-09-10 11:49:56 +08:00
parent ce947d4472
commit ec6e09ced1
6 changed files with 92 additions and 178 deletions

View File

@@ -16,7 +16,6 @@ namespace Serein.WorkBench.Node.View
private new readonly CompositeActionNode Node;
public ActionRegionControl() : base()
{
InitializeComponent();
}
@@ -27,38 +26,6 @@ namespace Serein.WorkBench.Node.View
base.Name = "动作组合节点";
}
#region
private void ResizeTop_DragDelta(object sender, DragDeltaEventArgs e)
{
double oldHeight = Height;
double newHeight = Math.Max(MinHeight, oldHeight - e.VerticalChange);
Height = newHeight;
Canvas.SetTop(this, Canvas.GetTop(this) + (oldHeight - newHeight));
}
private void ResizeBottom_DragDelta(object sender, DragDeltaEventArgs e)
{
double newHeight = Math.Max(MinHeight, Height + e.VerticalChange);
Height = newHeight;
}
private void ResizeLeft_DragDelta(object sender, DragDeltaEventArgs e)
{
double oldWidth = Width;
double newWidth = Math.Max(MinWidth, oldWidth - e.HorizontalChange);
Width = newWidth;
Canvas.SetLeft(this, Canvas.GetLeft(this) + (oldWidth - newWidth));
}
private void ResizeRight_DragDelta(object sender, DragDeltaEventArgs e)
{
double newWidth = Math.Max(MinWidth, Width + e.HorizontalChange);
Width = newWidth;
}
#endregion
public void AddAction(NodeControlBase node, bool isTask = false)
{
/*TextBlock actionText = new TextBlock