feat: add is_draggable method to improve swipe responsiveness

This commit is contained in:
2026-07-05 17:02:27 +08:00
parent 6f6dab1c04
commit c43f8e5458
+14
View File
@@ -110,6 +110,20 @@ class Scroll:
"""
return np.mean(self.match_color(main)) > 0.1
def is_draggable(self, main):
"""
If scroll `length` is just a little smaller than `total`,
game client may not respond to such a short swipe.
Args:
main (ModuleBase):
Returns:
bool:
"""
_ = self.cal_position(main)
return self.length / self.total < 0.95
def at_top(self, main):
return self.cal_position(main) < self.edge_threshold