From 64b315f30a5ed00845c5dcd0aa401baaa8adf940 Mon Sep 17 00:00:00 2001 From: Equbuxu Date: Sat, 8 Apr 2023 22:26:35 +0300 Subject: [PATCH] Fix navigation window not updating when you resize it --- src/PixiEditor/Models/DocumentModels/ActionAccumulator.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PixiEditor/Models/DocumentModels/ActionAccumulator.cs b/src/PixiEditor/Models/DocumentModels/ActionAccumulator.cs index 5275c5cdd..3568b5423 100644 --- a/src/PixiEditor/Models/DocumentModels/ActionAccumulator.cs +++ b/src/PixiEditor/Models/DocumentModels/ActionAccumulator.cs @@ -7,6 +7,7 @@ using PixiEditor.ChangeableDocument.ChangeInfos; using PixiEditor.DrawingApi.Core.Numerics; using PixiEditor.Helpers; +using PixiEditor.Models.DocumentPassthroughActions; using PixiEditor.Models.Rendering; using PixiEditor.Models.Rendering.RenderInfos; using PixiEditor.ViewModels.SubViewModels.Document; @@ -75,6 +76,7 @@ private async void TryExecuteAccumulatedActions() // update viewmodels based on changes List optimizedChanges = ChangeInfoListOptimizer.Optimize(changes); bool undoBoundaryPassed = toExecute.Any(static action => action is ChangeBoundary_Action or Redo_Action or Undo_Action); + bool viewportRefreshRequest = toExecute.Any(static action => action is RefreshViewport_PassthroughAction); foreach (IChangeInfo info in optimizedChanges) { internals.Updater.ApplyChangeFromChangeInfo(info); @@ -104,7 +106,7 @@ private async void TryExecuteAccumulatedActions() // update the contents of the bitmaps var affectedAreas = new AffectedAreasGatherer(internals.Tracker, optimizedChanges); List renderResult = new(); - renderResult.AddRange(await canvasUpdater.UpdateGatheredChunks(affectedAreas, undoBoundaryPassed)); + renderResult.AddRange(await canvasUpdater.UpdateGatheredChunks(affectedAreas, undoBoundaryPassed || viewportRefreshRequest)); renderResult.AddRange(await previewUpdater.UpdateGatheredChunks(affectedAreas, undoBoundaryPassed)); // lock bitmaps