2
0
Эх сурвалжийг харах

Fixed redo for document stuff

Krzysztof Krysiński 1 долоо хоног өмнө
parent
commit
bf07d82e63

+ 2 - 0
src/PixiEditor/Models/Controllers/ClipboardController.cs

@@ -11,6 +11,7 @@ using Avalonia.Input.Platform;
 using Avalonia.Media.Imaging;
 using Avalonia.Platform;
 using Avalonia.Platform.Storage;
+using Avalonia.Threading;
 using ChunkyImageLib;
 using PixiEditor.Helpers.Extensions;
 using PixiEditor.ChangeableDocument.Enums;
@@ -297,6 +298,7 @@ internal static class ClipboardController
         {
             if (await TryPasteNestedDocument(document, manager, data))
             {
+                manager.Owner.ToolsSubViewModel.SetActiveTool<MoveToolViewModel>(false);
                 return true;
             }
         }

+ 13 - 0
src/PixiEditor/Models/DocumentModels/ActionAccumulator.cs

@@ -80,6 +80,19 @@ internal class ActionAccumulator
         }
     }
 
+    public void AddActions(ActionSource actionSource, params IAction[] actions)
+    {
+        foreach (var action in actions)
+        {
+            queuedActions.Add((actionSource, action));
+        }
+
+        if (!isChangeBlockActive)
+        {
+            TryExecuteAccumulatedActions();
+        }
+    }
+
     public void AddActions(ActionSource source, IAction action)
     {
         queuedActions.Add((source, action));

+ 0 - 6
src/PixiEditor/Models/DocumentModels/DocumentUpdater.cs

@@ -1069,12 +1069,6 @@ internal class DocumentUpdater
                 info.OriginalFilePath, info.ReferenceId);
         }
 
-        if (info.OriginalFilePath != node.FilePath)
-        {
-            ViewModelMain.Current.DocumentManagerSubViewModel.ReloadDocumentReference(info.ReferenceId,
-                info.OriginalFilePath);
-        }
-
         node.SetOriginalFilePath(info.OriginalFilePath);
         node.SetReferenceId(info.ReferenceId);
         node.UpdateLinkedStatus();