A community-maintained Python framework for creating mathematical animations.
Make sure skipped wait calls use a longer dt
Grant Sanderson14a931664327
diff --git a/manimlib/scene/scene.py b/manimlib/scene/scene.pyindex 7a8b69f6b..c02bc98a1 100644--- a/manimlib/scene/scene.py+++ b/manimlib/scene/scene.py@@ -493,13 +493,15 @@ class Scene(Container):@handle_play_like_calldef wait(self, duration=DEFAULT_WAIT_TIME, stop_condition=None):- dt = 1 / self.camera.frame_rateself.update_mobjects(dt=0) # Any problems with this?if self.should_update_mobjects():time_progression = self.get_wait_time_progression(duration, stop_condition)# TODO, be smart about setting a static image# the same way Scene.play does+ last_t = 0for t in time_progression:+ dt = t - last_t+ last_t = tself.update_mobjects(dt)self.update_frame()self.add_frames(self.get_frame())@@ -511,6 +513,7 @@ class Scene(Container):return selfelse:self.update_frame()+ dt = 1 / self.camera.frame_raten_frames = int(duration / dt)frame = self.get_frame()self.add_frames(*[frame] * n_frames)