Преглед на файлове

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>());