Browse Source

Merge pull request #757 from PixiEditor/sync-backend

Made sync backend
Krzysztof Krysiński 6 months ago
parent
commit
ac1bb01428

+ 5 - 5
src/PixiEditor/Models/DocumentModels/ActionAccumulator.cs

@@ -82,7 +82,7 @@ internal class ActionAccumulator
         TryExecuteAccumulatedActions();
     }
 
-    internal async Task TryExecuteAccumulatedActions()
+    internal void TryExecuteAccumulatedActions()
     {
         if (executing || queuedActions.Count == 0)
             return;
@@ -109,7 +109,7 @@ internal class ActionAccumulator
                 }
                 else
                 {
-                    changes = await internals.Tracker.ProcessActions(toExecute);
+                    changes = internals.Tracker.ProcessActionsSync(toExecute);
                 }
 
                 List<IChangeInfo> optimizedChanges = ChangeInfoListOptimizer.Optimize(changes);
@@ -137,11 +137,11 @@ internal class ActionAccumulator
                     canvasUpdater.UpdateGatheredChunksSync(affectedAreas,
                         undoBoundaryPassed || viewportRefreshRequest);
                 }
-                else
+                /*else
                 {
                     await canvasUpdater.UpdateGatheredChunks(affectedAreas,
                         undoBoundaryPassed || viewportRefreshRequest);
-                }
+                }*/
 
                 previewUpdater.UpdatePreviews(undoBoundaryPassed || changeFrameRequest || viewportRefreshRequest,
                     affectedAreas.ImagePreviewAreas.Keys,
@@ -164,7 +164,7 @@ internal class ActionAccumulator
 #if DEBUG
             Console.WriteLine(e);
 #endif
-            await CrashHelper.SendExceptionInfoAsync(e);
+            CrashHelper.SendExceptionInfoAsync(e);
             throw;
         }
 

+ 2 - 2
src/PixiEditor/Models/DocumentModels/Public/ChangeBlock.cs

@@ -10,9 +10,9 @@ public class ChangeBlock : IDisposable
         Accumulator.StartChangeBlock();
     }
     
-    public async Task ExecuteQueuedActions()
+    public void ExecuteQueuedActions()
     {
-        await Accumulator.TryExecuteAccumulatedActions();
+        Accumulator.TryExecuteAccumulatedActions();
     }
     
     public void Dispose()

+ 1 - 1
src/PixiEditor/ViewModels/SubViewModels/ClipboardViewModel.cs

@@ -202,7 +202,7 @@ internal class ClipboardViewModel : SubViewModel<ViewModelMain>
             if (newIds.Count == 0)
                 return;
 
-            await block.ExecuteQueuedActions();
+            block.ExecuteQueuedActions();
 
             ConnectRelatedNodes(doc, nodeMapping);