Skip to content

Commit

Permalink
fix: restrict the range of index when moving through variations (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang authored Nov 19, 2023
1 parent 016b22d commit 703c63d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion katrain/gui/badukpan.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ def get_animate_pv_index(self):
if self.animating_pv:
pv, node, start_time, _ = self.animating_pv
delay = self.katrain.config("general/anim_pv_time", 0.5)
return (time.time() - start_time) / max(delay, 0.1)
return min(len(pv), (time.time() - start_time) / max(delay, 0.1))
else:
return 0

Expand Down

0 comments on commit 703c63d

Please sign in to comment.