Browse Source

Fixed middle mouse click up not returning to previous tool

CPKreuz 2 years ago
parent
commit
37df394ce5
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/PixiEditor/ViewModels/SubViewModels/Main/IoViewModel.cs

+ 5 - 2
src/PixiEditor/ViewModels/SubViewModels/Main/IoViewModel.cs

@@ -222,8 +222,11 @@ internal class IoViewModel : SubViewModel<ViewModelMain>
 
     private void OnMouseUp(object? sender, MouseButton button)
     {
-        if (drawingWithRight == null || (button == MouseButton.Left && drawingWithRight.Value) ||
-            (button == MouseButton.Right && !drawingWithRight.Value))
+        bool toLeftRightClick = drawingWithRight == null ||
+                                (button == MouseButton.Left && drawingWithRight.Value) ||
+                                (button == MouseButton.Right && !drawingWithRight.Value);
+        
+        if (toLeftRightClick && button != MouseButton.Middle)
             return;
 
         if (Owner.DocumentManagerSubViewModel.ActiveDocument is null)