瀏覽代碼

Fix bound calculation not done after a node has been removed from a node zone

CPKreuz 1 月之前
父節點
當前提交
85d756e24d
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/PixiEditor/ViewModels/Nodes/NodeFrameViewModelBase.cs

+ 7 - 1
src/PixiEditor/ViewModels/Nodes/NodeFrameViewModelBase.cs

@@ -44,10 +44,16 @@ public abstract class NodeFrameViewModelBase : ObservableObject
     private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
     {
         var action = e.Action;
-        if (action != NotifyCollectionChangedAction.Add && action != NotifyCollectionChangedAction.Remove && action != NotifyCollectionChangedAction.Replace && action != NotifyCollectionChangedAction.Reset)
+        if (action is
+            not NotifyCollectionChangedAction.Add and
+            not NotifyCollectionChangedAction.Remove and
+            not NotifyCollectionChangedAction.Replace and
+            not NotifyCollectionChangedAction.Reset)
         {
             return;
         }
+
+        CalculateBounds();
         
         if (e.NewItems != null)
             AddHandlers(e.NewItems.Cast<INodeHandler>());