This commit is contained in:
kwai
2023-04-07 19:21:27 +08:00
parent afea559325
commit 347488e8e9
3 changed files with 7 additions and 14 deletions

View File

@@ -2475,11 +2475,13 @@ namespace AIStudio.Wpf.DiagramDesigner
DoCommandManager.DoNewCommand(this.ToString(),
() => {
//ToDo,整体移动到中心,而不是单个移动到中心
var BoundingRect = DiagramViewModelHelper.GetBoundingRectangle(selectedItems);
var oldcenter = BoundingRect.Center;
foreach (var item in selectedItems.OfType<DesignerItemViewModelBase>())
{
item.Left = (PageSize.Width - item.ItemWidth) / 2;
item.Top = (PageSize.Height - item.ItemHeight) / 2;
item.Left = item.Left - oldcenter.X + PageSize.Width / 2;
item.Top = item.Top - oldcenter.Y + PageSize.Height / 2;
}
FitViewModel = new FitViewModel() { BoundingRect = DiagramViewModelHelper.GetBoundingRectangle(selectedItems) };
@@ -2678,9 +2680,8 @@ namespace AIStudio.Wpf.DiagramDesigner
GroupDesignerItemViewModel groupItem = null;
if (parameter is IEnumerable<DesignerItemViewModelBase> para)
{
if (para.FirstOrDefault() is GroupDesignerItemViewModel groupDesignerItemViewModel && groupDesignerItemViewModel.Custom)
if (para.FirstOrDefault() is GroupDesignerItemViewModel groupDesignerItemViewModel)
{
groupDesignerItemViewModel.Custom = false;
groupItem = groupDesignerItemViewModel;
items = para.Skip(1).ToList();
}