mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 03:17:43 +00:00
Change ignore_skipping name to force_draw
This commit is contained in:
parent
a5ba721f96
commit
65d5947966
1 changed files with 6 additions and 7 deletions
|
|
@ -269,8 +269,7 @@ class Scene(object):
|
|||
# Operation to run after each ipython command
|
||||
def post_cell_func(*args, **kwargs):
|
||||
if not self.is_window_closing():
|
||||
self.window._has_undrawn_event = True
|
||||
self.update_frame(dt=0, ignore_skipping=True)
|
||||
self.update_frame(dt=0, force_draw=True)
|
||||
|
||||
shell.events.register("post_run_cell", post_cell_func)
|
||||
|
||||
|
|
@ -314,19 +313,19 @@ class Scene(object):
|
|||
return image
|
||||
|
||||
def show(self) -> None:
|
||||
self.update_frame(ignore_skipping=True)
|
||||
self.update_frame(force_draw=True)
|
||||
self.get_image().show()
|
||||
|
||||
def update_frame(self, dt: float = 0, ignore_skipping: bool = False) -> None:
|
||||
def update_frame(self, dt: float = 0, force_draw: bool = False) -> None:
|
||||
self.increment_time(dt)
|
||||
self.update_mobjects(dt)
|
||||
if self.skip_animations and not ignore_skipping:
|
||||
if self.skip_animations and not force_draw:
|
||||
return
|
||||
|
||||
if self.is_window_closing():
|
||||
raise EndScene()
|
||||
|
||||
if self.window and dt == 0 and not self.window.has_undrawn_event():
|
||||
if self.window and dt == 0 and not self.window.has_undrawn_event() and not force_draw:
|
||||
# In this case, there's no need for new rendering, but we
|
||||
# shoudl still listen for new events
|
||||
self.window._window.dispatch_events()
|
||||
|
|
@ -609,7 +608,7 @@ class Scene(object):
|
|||
|
||||
if self.skip_animations and self.window is not None:
|
||||
# Show some quick frames along the way
|
||||
self.update_frame(dt=0, ignore_skipping=True)
|
||||
self.update_frame(dt=0, force_draw=True)
|
||||
|
||||
self.num_plays += 1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue