Skip to content

Commit 8c578d2

Browse files
fix(cli): do not terminate slides early (#162)
* fix(cli): do not terminate slides early When a slide is replayed (either normally or reversed), its state must be reset. Closes #161 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2a327c4 commit 8c578d2

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

example.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,25 @@ def construct(self):
3232
self.next_slide() # Waits user to press continue to go to the next slide
3333

3434

35+
class MultipleAnimationsInLastSlide(Slide):
36+
"""This is used to check against solution for issue #161."""
37+
38+
def construct(self):
39+
circle = Circle(color=BLUE)
40+
dot = Dot()
41+
42+
self.play(GrowFromCenter(circle))
43+
self.play(FadeIn(dot))
44+
self.next_slide()
45+
46+
self.play(dot.animate.move_to(RIGHT))
47+
self.play(dot.animate.move_to(UP))
48+
self.play(dot.animate.move_to(LEFT))
49+
self.play(dot.animate.move_to(DOWN))
50+
51+
self.next_slide()
52+
53+
3554
class TestFileTooLong(Slide):
3655
"""This is used to check against solution for issue #123."""
3756

manim_slides/present.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ def current_cap(self) -> cv2.VideoCapture:
199199
def rewind_current_slide(self) -> None:
200200
"""Rewinds current slide to first frame."""
201201
logger.debug("Rewinding current slide")
202+
self.current_slide.terminated = False
203+
202204
if self.reverse:
203205
self.current_animation = self.current_slide.end_animation - 1
204206
else:

0 commit comments

Comments
 (0)