Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boundsInside(0, 0, -1, -1)筛选无效 #49

Closed
ChrisCatCP opened this issue Apr 26, 2023 · 3 comments
Closed

boundsInside(0, 0, -1, -1)筛选无效 #49

ChrisCatCP opened this issue Apr 26, 2023 · 3 comments
Labels
Apperception 🎯 统觉 Issue closed by the creater on his or her own Bug 🐞 故障 Confirmed bugs or reports that are very likely to be bugs Proposal 💡 方案 Issue creater's own proposal which may be really helpful Settled 🌴 完成 Happy ending for both human beings and issues themselves

Comments

@ChrisCatCP
Copy link

在使用boundsInside(0, 0, -1, -1)筛选屏幕内的控件是 (93,247 - 1023,-1127) 这种bottom为负数的控件无法排除
使用boundsInside(0, 0, device.width , device.height) 也是一样

@ChrisCatCP
Copy link
Author

filter((w)=>{
    let bounds = w.bounds();
    let left = Math.min(bounds.left,bounds.right);
    let right = Math.max(bounds.left,bounds.right);
    let top = Math.min(bounds.top,bounds.bottom);
    let bottom = Math.max(bounds.top,bounds.bottom);
    let screen = new android.graphics.Rect(0,0,device.width,device.height);
    return screen.contains(new android.graphics.Rect(left,top,right,bottom));
  })

这样解决了 但是如果能添加到源码就好了
我这边无法正常编译 apkbuilder那个库没有权限

@SuperMonster003
Copy link
Owner

已于 v6.3.0 尝试修复上述问题.
包括 [ 边界倒置控件矩形筛选 / ApkBuilder 依赖无法访问 ].
如问题复现, 可继续反馈.

另外你提供的 filter 解决思路是可行的, 你也可以参考 AutoJs6 v6.3.0 的解决方法:
https://github.com/SuperMonster003/AutoJs6/blob/6ff598d587d37d672d3e21c807694b600f92c6c8/app/src/main/java/org/autojs/autojs/core/automator/filter/BoundsFilter.kt

@SuperMonster003 SuperMonster003 added Bug 🐞 故障 Confirmed bugs or reports that are very likely to be bugs Feedback Awaited 🕒 等待反馈 Waiting for the feedback from issue creater and issue will be closed if duration is over one month Proposal 💡 方案 Issue creater's own proposal which may be really helpful labels Apr 29, 2023
@ChrisCatCP
Copy link
Author

新版对于倒置控件能正确筛选了

@SuperMonster003 SuperMonster003 added Settled 🌴 完成 Happy ending for both human beings and issues themselves Apperception 🎯 统觉 Issue closed by the creater on his or her own and removed Feedback Awaited 🕒 等待反馈 Waiting for the feedback from issue creater and issue will be closed if duration is over one month labels Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apperception 🎯 统觉 Issue closed by the creater on his or her own Bug 🐞 故障 Confirmed bugs or reports that are very likely to be bugs Proposal 💡 方案 Issue creater's own proposal which may be really helpful Settled 🌴 完成 Happy ending for both human beings and issues themselves
Projects
None yet
Development

No branches or pull requests

2 participants