浏览代码

Refactor, early exit.

Ruben 3 月之前
父节点
当前提交
387ac49ed3
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      src/PicView.Avalonia/WindowBehavior/WindowResizing.cs

+ 10 - 1
src/PicView.Avalonia/WindowBehavior/WindowResizing.cs

@@ -30,7 +30,6 @@ public static class WindowResizing
             return;
         }
 
-
         var oldSize = size.OldValue.Value;
         var newSize = size.NewValue.Value;
 
@@ -39,6 +38,16 @@ public static class WindowResizing
 
         window.Position = new PixelPoint(window.Position.X + (int)x, window.Position.Y + (int)y);
 
+        if (vm.MainWindow is
+            {
+                IsNavigationButtonLeftClicked: false, IsNavigationButtonRightClicked: false,
+                IsClickArrowLeftClicked: false, IsClickArrowRightClicked: false, IsRotateLeftClicked: false,
+                IsRotateRightClicked: false, IsTopToolbarRotationClicked: false
+            })
+        {
+            return;
+        }
+
         RepositionCursorIfTriggered(vm, vm.MainWindow.IsNavigationButtonLeftClicked,
             clicked => vm.MainWindow.IsNavigationButtonLeftClicked = clicked,
             () => UIHelper.GetBottomBar.GetControl<Button>("PreviousButton"),