Browse Source

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

CPKreuz 1 tháng trước cách đây
mục cha
commit
85d756e24d
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  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>());