From be02d56336f799817553a997b8629cddc7a666ff Mon Sep 17 00:00:00 2001 From: Michele Sanna <{ID}+{username}@users.noreply.github.com> Date: Wed, 25 Jan 2023 15:47:21 +0100 Subject: [PATCH] circumvent aspect ratio arithmetic error when window is accidentally resized to h=0 --- pyrender/camera.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrender/camera.py b/pyrender/camera.py index e019358..3a7ec69 100644 --- a/pyrender/camera.py +++ b/pyrender/camera.py @@ -184,7 +184,7 @@ def get_projection_matrix(self, width=None, height=None): if aspect_ratio is None: if width is None or height is None: raise ValueError('Aspect ratio of camera must be defined') - aspect_ratio = float(width) / float(height) + aspect_ratio = float(width) / (float(height) + 1e-6) a = aspect_ratio t = np.tan(self.yfov / 2.0)