1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 03:58:22 +08:00

Fix: Delete nearing swipe way points, to prevent AL treats it as click

This commit is contained in:
LmeSzinc
2021-02-18 16:46:03 +08:00
parent 4290f959b9
commit 5b8fa84db2
2 changed files with 9 additions and 0 deletions

View File

@@ -115,6 +115,10 @@ class Control(MiniTouch):
logger.info(
'Swipe %s -> %s, %s' % (point2str(*start), point2str(*end), duration)
)
if np.linalg.norm(np.subtract(start, end)) < 10:
# Should swipe a certain distabce, otherwise AL will treat it as click.
# uiautomator2 should >= 6px, minitouch should >= 5px
logger.info('Swipe distance < 10px, dropped')
fx, fy, tx, ty = np.append(start, end).tolist()
method = self.config.DEVICE_CONTROL_METHOD