fix the ZeroDivisionError occured in int(image_width / aspect_ratio) when aspect_ratio equals zero (#2177)

fix the ZeroDivisionError occured in int(image_width / aspect_ratio)

Co-authored-by: Web <iamwebgao@163.com>
This commit is contained in:
Weibo GaoandWeb authored and GitHub committed 2023-07-06 10:38:10 -07:00
1 parent c7def8ce8c
commit 77cf4c88ed
1 file changed
+2
@@ -243,6 +243,8 @@ class RenderStateMachine(threading.Thread):
image_height: the maximum image height that can be rendered in the time budget
image_width: the maximum image width that can be rendered in the time budget
"""
if aspect_ratio == 0:
aspect_ratio = 0.001
max_res = self.viewer.control_panel.max_res
if self.state == "high":
# high res is always static