Skip to content

Commit

Permalink
fix: restrict the range of index
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Nov 18, 2023
1 parent 98ce47c commit db755ec
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 db755ec

Please sign in to comment.