Skip to content

Commit

Permalink
fix(script): 将软件辅助的点击设置成点击元素中心点
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Nov 22, 2023
1 parent cc0c3a7 commit a0e421d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/scripts/src/utils/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ export const $app_actions = {
await $.sleep(1000);
const rect = elementOrSelector.getBoundingClientRect();
return await appActionRequest({
x: rect.x.toString(),
y: rect.y.toString(),
// 计算元素中心点
x: (rect.left + rect.width / 2).toString(),
y: (rect.top + rect.height / 2).toString(),
count: count.toString(),
action: 'mouse-click'
});
Expand Down

0 comments on commit a0e421d

Please sign in to comment.