mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Fix: [ALAS] insert_swipe() may return a length=1 list after deleting nearing points
(cherry picked from commit 75333193ea561bd1f4241364c8660f6526bb5431)
This commit is contained in:
parent
74a2ccf2dc
commit
2ae0f5e4b9
@ -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)
|
distance = np.linalg.norm(np.subtract(points[1:], points[0]), axis=1)
|
||||||
mask = np.append(True, distance > min_distance)
|
mask = np.append(True, distance > min_distance)
|
||||||
points = np.array(points)[mask].tolist()
|
points = np.array(points)[mask].tolist()
|
||||||
|
if len(points) <= 1:
|
||||||
|
points = [p0, p3]
|
||||||
else:
|
else:
|
||||||
points = [p0, p3]
|
points = [p0, p3]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user