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

Fix: [ALAS] insert_swipe() may return a length=1 list after deleting nearing points

This commit is contained in:
LmeSzinc
2024-05-01 23:40:17 +08:00
parent 04538c4b1a
commit 75333193ea

View File

@@ -86,6 +86,8 @@ def insert_swipe(p0, p3, speed=15, min_distance=10):
distance = np.linalg.norm(np.subtract(points[1:], points[0]), axis=1)
mask = np.append(True, distance > min_distance)
points = np.array(points)[mask].tolist()
if len(points) <= 1:
points = [p0, p3]
else:
points = [p0, p3]