From 703c63d5a079e5e6ff10f8673a6399b79abc54e5 Mon Sep 17 00:00:00 2001 From: xiaoyifang <105986+xiaoyifang@users.noreply.github.com> Date: Sun, 19 Nov 2023 19:18:09 +0800 Subject: [PATCH] fix: restrict the range of index when moving through variations (#670) --- katrain/gui/badukpan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/katrain/gui/badukpan.py b/katrain/gui/badukpan.py index ef9730d3..c3cf9cd2 100644 --- a/katrain/gui/badukpan.py +++ b/katrain/gui/badukpan.py @@ -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