Browse Source

Fixed mid change redo

flabbet 10 months ago
parent
commit
ee00b20b30
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/PixiEditor/ViewModels/SubViewModels/UndoViewModel.cs

+ 3 - 2
src/PixiEditor/ViewModels/SubViewModels/UndoViewModel.cs

@@ -1,6 +1,7 @@
 using Avalonia.Input;
 using PixiEditor.Models.Commands.Attributes.Commands;
 using PixiEditor.Models.Commands.Attributes.Evaluators;
+using PixiEditor.Models.DocumentModels.UpdateableChangeExecutors.Features;
 using PixiEditor.UI.Common.Fonts;
 
 namespace PixiEditor.ViewModels.SubViewModels;
@@ -21,7 +22,7 @@ internal class UndoViewModel : SubViewModel<ViewModelMain>
     public void Redo()
     {
         var doc = Owner.DocumentManagerSubViewModel.ActiveDocument;
-        if (doc is null || (!doc.BlockingUpdateableChangeActive && !doc.HasSavedRedo))
+        if (doc is null || (!doc.IsChangeFeatureActive<IMidChangeUndoableExecutor>() && !doc.HasSavedRedo))
             return;
         doc.Operations.Redo();
     }
@@ -64,6 +65,6 @@ internal class UndoViewModel : SubViewModel<ViewModelMain>
         var doc = Owner.DocumentManagerSubViewModel.ActiveDocument;
         if (doc is null)
             return false;
-        return doc.BlockingUpdateableChangeActive || doc.HasSavedRedo;
+        return doc.IsChangeFeatureActive<IMidChangeUndoableExecutor>() || doc.HasSavedRedo;
     }
 }