Browse Source

Don't call reset zoom when not needed

Ruben 7 months ago
parent
commit
0b6bf71220

+ 1 - 1
src/PicView.Avalonia/StartUp/QuickLoad.cs

@@ -56,7 +56,7 @@ public static class QuickLoad
         
         await Dispatcher.UIThread.InvokeAsync(() =>
         {
-            vm.ImageViewer.SetTransform(imageModel.EXIFOrientation);
+            vm.ImageViewer.SetTransform(imageModel.EXIFOrientation, false);
             if (Settings.WindowProperties.AutoFit && !Settings.Zoom.ScrollEnabled)
             {
                 SetSize();

+ 5 - 2
src/PicView.Avalonia/Views/ImageViewer.axaml.cs

@@ -313,7 +313,7 @@ public partial class ImageViewer : UserControl
         }
     }
 
-    public void SetTransform(EXIFHelper.EXIFOrientation? orientation)
+    public void SetTransform(EXIFHelper.EXIFOrientation? orientation, bool resetZoom = true)
     {
         if (Dispatcher.UIThread.CheckAccess())
         {
@@ -338,7 +338,10 @@ public partial class ImageViewer : UserControl
                 default:
                 case EXIFHelper.EXIFOrientation.None:
                 case EXIFHelper.EXIFOrientation.Horizontal:
-                    ResetZoom();;
+                    if (resetZoom)
+                    {
+                        ResetZoom();
+                    }
                     return;
                 case EXIFHelper.EXIFOrientation.MirrorHorizontal:
                     SetTransform(-1, 0);