Forráskód Böngészése

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

CPKreuz 1 hónapja
szülő
commit
85d756e24d

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