luckyxiang
2018-09-03 12:39:00 +08:00
这个是屏幕分辨率适配的问题,在 main.js 引入缩放代码,详细可以看下我博客的处理办法.
```
var devInnerHeight = 1080.0 // 开发时的 InnerHeight
var devDevicePixelRatio = 1.0// 开发时的 devicepixelratio
var devScaleFactor = 1.3 // 开发时的 ScaleFactor
var scaleFactor = require('electron').screen.getPrimaryDisplay().scaleFactor
var zoomFactor = (window.innerHeight / devInnerHeight) * (window.devicePixelRatio / devDevicePixelRatio) * (devScaleFactor / scaleFactor)
require('electron').webFrame.setZoomFactor(zoomFactor)
```