From 3d9a0cd25e4604625b9740a98c46f4c5e272a10d Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Thu, 12 Dec 2024 16:16:45 -0600 Subject: [PATCH] Move resizing out of Window.focus, and into Window.init_for_scene (#2274) --- manimlib/window.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manimlib/window.py b/manimlib/window.py index c711e04b..ad2a92d3 100644 --- a/manimlib/window.py +++ b/manimlib/window.py @@ -69,7 +69,8 @@ class Window(PygletWindow): mglw.activate_context(window=self, ctx=self.ctx) self.timer.start() - self.focus() + # This line seems to resync the viewport + self.on_resize(*self.size) def get_monitor(self, index): try: @@ -106,8 +107,6 @@ class Window(PygletWindow): """ self._window.set_visible(False) self._window.set_visible(True) - # This line seems to resync the viewport - self.on_resize(*self.size) def to_default_position(self): self.position = self.default_position