mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-10 07:02:06 +00:00
fix: ensure minimum points in minitouch for valid distance calculation
This commit is contained in:
@@ -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]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user