Explorar o código

解决屏幕分辨率小于客户端分辨率显示不全的bug

liuwei %!s(int64=4) %!d(string=hai) anos
pai
achega
b07f9a3130
Modificáronse 1 ficheiros con 9 adicións e 6 borrados
  1. 9 6
      src/renderer/App.vue

+ 9 - 6
src/renderer/App.vue

@@ -53,12 +53,15 @@
       })
 
       // 更新vuex中的缩放比例
-      // axios.get('static/Data/EnityWindow.Data').then(async res => {
-      //   if (res.status === 200) {
-      //         const bigScale = window.screen.height/res.data[0].Height
-      //         this.$store.dispatch('updateScale',bigScale)
-      //     }
-      // })
+      axios.get('static/Data/EnityWindow.Data').then(async res => {
+        if (res.status === 200) {
+              // 当屏幕分辨率小于客户端分辨率时,所有元素大小位置同样缩小
+              if(window.screen.width<res.data[0].Width){
+                const bigScale = window.screen.width/res.data[0].Width
+                this.$store.dispatch('updateScale',bigScale)
+              }
+          }
+      })
     }
   }
 </script>