Skip to content

Commit 3564aa9

Browse files
committed
(#160) Fixed offset issue
1 parent 9ccc8f1 commit 3564aa9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/screen.class.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,16 @@ export class Screen {
105105
for (const hook of possibleHooks) {
106106
await hook(matchResult);
107107
}
108+
const resultRegion = new Region(
109+
searchRegion.left + matchResult.location.left,
110+
searchRegion.top + matchResult.location.top,
111+
matchResult.location.width,
112+
matchResult.location.height
113+
)
108114
if (this.config.autoHighlight) {
109-
resolve(this.highlight(matchResult.location));
115+
resolve(this.highlight(resultRegion));
110116
} else {
111-
resolve(matchResult.location);
117+
resolve(resultRegion);
112118
}
113119
} else {
114120
reject(

0 commit comments

Comments
 (0)