Browse Source

Fixed nudging change frame

flabbet 7 months ago
parent
commit
73944e374f
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/PixiEditor/ViewModels/SubViewModels/AnimationsViewModel.cs

+ 11 - 1
src/PixiEditor/ViewModels/SubViewModels/AnimationsViewModel.cs

@@ -26,7 +26,7 @@ internal class AnimationsViewModel : SubViewModel<ViewModelMain>
     public void ChangeActiveFrame(int nudgeBy)
     {
         var activeDocument = Owner.DocumentManagerSubViewModel.ActiveDocument;
-        if (activeDocument is null || activeDocument.TransformViewModel.TransformActive)
+        if (activeDocument is null || IsTransforming())
             return;
 
         int newFrame = activeDocument.AnimationDataViewModel.ActiveFrameBindable + nudgeBy;
@@ -191,4 +191,14 @@ internal class AnimationsViewModel : SubViewModel<ViewModelMain>
 
         document.Operations.SetActiveFrame((int)value);
     }
+    
+    private bool IsTransforming()
+    {
+        var activeDocument = Owner.DocumentManagerSubViewModel.ActiveDocument;
+        if (activeDocument is null)
+            return false;
+        
+        return activeDocument.TransformViewModel.TransformActive || activeDocument.LineToolOverlayViewModel.IsEnabled
+            || activeDocument.PathOverlayViewModel.IsActive;
+    }
 }