Update Scene.get_image to resize window if needed

This commit is contained in:
Grant Sanderson 2023-01-24 12:05:08 -08:00
parent 1dda706335
commit b99b88fd25

View file

@ -289,7 +289,15 @@ class Scene(object):
# Only these methods should touch the camera
def get_image(self) -> Image:
return self.camera.get_image()
if self.window is not None:
self.window.size = self.camera.get_pixel_shape()
self.window.swap_buffers()
self.update_frame()
self.window.swap_buffers()
image = self.camera.get_image()
if self.window is not None:
self.window.to_default_position()
return image
def show(self) -> None:
self.update_frame(ignore_skipping=True)