From 4a95592b67611e885d9a6bcd570a3f2a5b5cda2c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 14 May 2019 14:14:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3HiDPI/Retina=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=99=A8=E8=BF=9B=E5=85=A5tpi=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=BC=A9=E6=94=BE=E6=AF=94=E4=BE=8B=E5=8F=98?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/educoder/edu_application.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/javascripts/educoder/edu_application.js b/public/javascripts/educoder/edu_application.js index 5d81c572..47705d21 100644 --- a/public/javascripts/educoder/edu_application.js +++ b/public/javascripts/educoder/edu_application.js @@ -1113,13 +1113,16 @@ function _initZoomCheck() { if (!IsPC()) { // 手机端不需要提示 return; } - var isNormalZoom = Math.round(window.devicePixelRatio * 100) === 100 + var ratio = Math.round(window.devicePixelRatio * 100); + // A value of 1 indicates a classic 96 DPI (76 DPI on some platforms) display, while a value of 2 is expected for HiDPI/Retina displays + var isNormalZoom = ratio === 100 || ratio === 200 if (!isNormalZoom) { suofang(); } $(window).resize(function() { - var isNormalZoom = Math.round(window.devicePixelRatio * 100) === 100 + var ratio = Math.round(window.devicePixelRatio * 100); + var isNormalZoom = ratio === 100 || ratio === 200 if (!isNormalZoom) { suofang(); } else {