getDevicePixelRatio static method
根据设置 的 宽度 来得到 devicePixelRatio
Implementation
static double getDevicePixelRatio() {
var originalSize = window.physicalSize / window.devicePixelRatio;
var originalWidth = originalSize.width;
var originalHeight = originalSize.height;
if (originalHeight > originalWidth) {
// 竖屏
_devicePixelRatio =
window.physicalSize.width / AutoSizeUtil._screenStandard;
} else {
// 横屏
_devicePixelRatio =
window.physicalSize.height / AutoSizeUtil._screenStandard;
}
return _devicePixelRatio;
}