From c17b06dcd4cf90490fa1565ed4025de6423511e4 Mon Sep 17 00:00:00 2001 From: CPPAlien Date: Mon, 16 Jul 2018 15:59:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA=20ios=206.?= =?UTF-8?q?6.6=20=E4=B8=8A=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- painter.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/painter.js b/painter.js index 625b1c5..a8ef3a7 100644 --- a/painter.js +++ b/painter.js @@ -63,10 +63,9 @@ Component({ return; } - if (!getApp().painterScreenRatio) { + if (!(getApp().systemInfo && getApp().systemInfo.screenWidth)) { try { - const systemInfo = wx.getSystemInfoSync(); - getApp().painterScreenRatio = systemInfo.screenWidth / 750; + getApp().systemInfo = wx.getSystemInfoSync(); } catch (e) { const error = `Painter get system info failed, ${JSON.stringify(e)}`; that.triggerEvent('imgErr', { error: error }); @@ -74,7 +73,7 @@ Component({ return; } } - screenK = getApp().painterScreenRatio; + screenK = getApp().systemInfo.screenWidth / 750; this.downloadImages().then((palette) => { const { width, height } = palette;