mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-26 02:56:35 +08:00
优化了画布平移、缩放、改变尺寸
This commit is contained in:
@@ -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