Bläddra i källkod

阅读页- 修复按住Ctrl+鼠标滚轮。缩放页面大小不流畅,缩放跨度太大的问题

OYXH\oyxh 1 år sedan
förälder
incheckning
e8959c568d
1 ändrade filer med 12 tillägg och 6 borttagningar
  1. 12 6
      PDF Office/ViewModels/ViewContentViewModel.cs

+ 12 - 6
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -742,6 +742,12 @@ namespace PDF_Master.ViewModels
         /// </summary>
         private double[] zoomLevel = { 1.00f, 10, 25, 50, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000, 2000, 4000, 10000 };
 
+        /// <summary>
+        /// 鼠标滚轮缩放的缩放值
+        /// 为了提高滚轮缩放 丝滑度
+        /// </summary>
+        private double[] zoomLevel2 = { 1.00f, 10, 15, 20, 25, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 135, 145, 150, 160, 170, 180, 190, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 2000, 3000, 4000, 6000, 10000 };
+
         /// <summary>
         /// 注释-链接,提示语
         /// </summary>
@@ -2215,7 +2221,7 @@ namespace PDF_Master.ViewModels
 
         public void SearchTextFocus(SearchContent searchContent)
         {
-            if (searchContent!=null&&searchContent.SearchText!=null&& string.IsNullOrEmpty(searchContent.SearchText.Text) == false)
+            if (searchContent != null && searchContent.SearchText != null && string.IsNullOrEmpty(searchContent.SearchText.Text) == false)
             {
                 searchContent.SearchText.Dispatcher.BeginInvoke(new Action(() =>
                 {
@@ -2533,16 +2539,16 @@ namespace PDF_Master.ViewModels
             }
 
             zoom *= 100;
-            for (int i = 0; i < zoomLevel.Length - 1; i++)
+            for (int i = 0; i < zoomLevel2.Length - 1; i++)
             {
-                if (zoom > zoomLevel[i] && zoom <= zoomLevel[i + 1] && IsGrowth)
+                if (zoom > zoomLevel2[i] && zoom <= zoomLevel2[i + 1] && IsGrowth)
                 {
-                    standardZoom = zoomLevel[i + 1];
+                    standardZoom = zoomLevel2[i + 1];
                     break;
                 }
-                if (zoom >= zoomLevel[i] && zoom < zoomLevel[i + 1] && !IsGrowth)
+                if (zoom >= zoomLevel2[i] && zoom < zoomLevel2[i + 1] && !IsGrowth)
                 {
-                    standardZoom = zoomLevel[i];
+                    standardZoom = zoomLevel2[i];
                     break;
                 }
             }