From 2d2743cbb12a2511187c5f8c0ca4f18bc81eba82 Mon Sep 17 00:00:00 2001 From: muwoo <2424880409@qq.com> Date: Thu, 19 Aug 2021 14:03:50 +0800 Subject: [PATCH] =?UTF-8?q?ref:=20=E4=BC=98=E5=8C=96=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/common/listener.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/common/listener.js b/src/main/common/listener.js index 7c20953..c86e5cf 100644 --- a/src/main/common/listener.js +++ b/src/main/common/listener.js @@ -85,7 +85,13 @@ class Listener { init(mainWindow) { this.fn = throttle(({x, y}, picker) => { - const img = robot.screen.capture(parseInt(x) - 5, parseInt(y) - 5, 9, 9); + const { scaleFactor } = screen.getDisplayNearestPoint({x, y}); + const img = robot.screen.capture( + x - parseInt(5 / scaleFactor), + y - parseInt(5 / scaleFactor), + 10, + 10 + ); const colors = {}