mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
优化了画布平移、缩放、改变尺寸
This commit is contained in:
@@ -16,14 +16,6 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Thumb x:Name="ResizeTop" Cursor="SizeNS" Height="4" HorizontalAlignment="Stretch" VerticalAlignment="Top"
|
||||
DragDelta="ResizeTop_DragDelta"/>
|
||||
<Thumb x:Name="ResizeBottom" Cursor="SizeNS" Height="4" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"
|
||||
DragDelta="ResizeBottom_DragDelta"/>
|
||||
<Thumb x:Name="ResizeLeft" Cursor="SizeWE" Width="4" HorizontalAlignment="Left" VerticalAlignment="Stretch"
|
||||
DragDelta="ResizeLeft_DragDelta"/>
|
||||
<Thumb x:Name="ResizeRight" Cursor="SizeWE" Width="4" HorizontalAlignment="Right" VerticalAlignment="Stretch"
|
||||
DragDelta="ResizeRight_DragDelta"/>
|
||||
</Grid>
|
||||
|
||||
</local:NodeControlBase>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -20,14 +20,5 @@
|
||||
<ListBox x:Name="ConditionsListBox" AllowDrop="True" Drop="ConditionsListBox_Drop"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Thumb x:Name="ResizeTop" Cursor="SizeNS" Height="4" HorizontalAlignment="Stretch" VerticalAlignment="Top"
|
||||
DragDelta="ResizeTop_DragDelta"/>
|
||||
<Thumb x:Name="ResizeBottom" Cursor="SizeNS" Height="4" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"
|
||||
DragDelta="ResizeBottom_DragDelta"/>
|
||||
<Thumb x:Name="ResizeLeft" Cursor="SizeWE" Width="4" HorizontalAlignment="Left" VerticalAlignment="Stretch"
|
||||
DragDelta="ResizeLeft_DragDelta"/>
|
||||
<Thumb x:Name="ResizeRight" Cursor="SizeWE" Width="4" HorizontalAlignment="Right" VerticalAlignment="Stretch"
|
||||
DragDelta="ResizeRight_DragDelta"/>
|
||||
</Grid>
|
||||
</local:NodeControlBase>
|
||||
|
||||
@@ -23,36 +23,6 @@ namespace Serein.WorkBench.Node.View
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
#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
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user