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

Add drag log and fix ValueError in insert_swipe

This commit is contained in:
LmeSzinc
2021-09-14 12:39:16 +08:00
parent 071eec530a
commit 67dfb7b83c
2 changed files with 9 additions and 3 deletions

View File

@@ -93,9 +93,12 @@ def insert_swipe(p0, p3, speed=15):
prev = point
# Delete nearing points
distance = np.linalg.norm(np.subtract(points[1:], points[0]), axis=1)
mask = np.append(True, distance > 10)
points = np.array(points)[mask].tolist()
if len(points[1:]):
distance = np.linalg.norm(np.subtract(points[1:], points[0]), axis=1)
mask = np.append(True, distance > 10)
points = np.array(points)[mask].tolist()
else:
points = [p0, p3]
return points