From 58b40bd4e4a4ba91d17282262c2f2320694419ee Mon Sep 17 00:00:00 2001 From: lzghzr Date: Sun, 11 Aug 2019 15:58:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=B8=8D=E5=90=8C=E5=88=86?= =?UTF-8?q?=E8=BE=A8=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 56b41f7..ff42de1 100644 --- a/main.js +++ b/main.js @@ -19,6 +19,7 @@ if (device.width / device.height > 1) { console.error('请将模拟器调为竖屏模式(手机模式),推荐分辨率720*1280,当前', device.width, '*', device.height) exit() } +const FACTOR = device.width / 720 function capture() { let cap = captureScreen() @@ -72,7 +73,8 @@ function findAndClick(config) { let imgs = {} for (var i in match) { let fileName = match[i].name - imgs[i] = images.read(BASE + fileName + '.png') + let img = images.read(BASE + fileName + '.png') + imgs[i] = images.scale(img, FACTOR, FACTOR) if (imgs[i] === null) { toast(fileName + '无法被读取') console.error(fileName, '无法被读取')