fix: 全桌面查找结果加回拼接画布物理原点, 修复副屏点击垂直偏移

This commit is contained in:
yu 2026-11-03 13:07:12 +08:00
parent e7669acd16
commit 3922447689

View File

@ -407,6 +407,10 @@ async function locate(args: Record<string, unknown>, evidenceDir: string, nodeId
offsetY = phys.y;
} else {
await fs.writeFile(screenshot, PNG.sync.write(shot.png));
// 拼接画布坐标 → 屏幕物理坐标必须加回画布原点(副屏在主屏左侧/上方时原点为负);
// 漏加会导致点击偏移(实测副屏上移 177px 时点击正好偏下 177px)
offsetX = shot.originX;
offsetY = shot.originY;
}
// accuracy 字段语义为「相似度」(0~1, 越大越严格, 0.9=至少90%像素一致)——与界面文案一致。