ref: 优化取色功能

This commit is contained in:
muwoo 2021-08-19 14:03:50 +08:00
parent efccc2b091
commit 2d2743cbb1

View File

@ -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 = {}