From 2788c6f32c992c34506717af20e9c24a7f1d86ac Mon Sep 17 00:00:00 2001 From: kushalkolar Date: Thu, 12 Oct 2023 02:17:20 -0400 Subject: [PATCH] fix longstanding issue where auto_scale didn't work with zero width or height --- fastplotlib/layouts/_base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fastplotlib/layouts/_base.py b/fastplotlib/layouts/_base.py index c5dcb0581..cf9c45ad9 100644 --- a/fastplotlib/layouts/_base.py +++ b/fastplotlib/layouts/_base.py @@ -420,6 +420,12 @@ def auto_scale(self, maintain_aspect: bool = False, zoom: float = 0.8): else: width, height, depth = (1, 1, 1) + # make sure width and height are non-zero + if width < 0.01: + width = 1 + if height < 0.01: + height = 1 + for selector in self.selectors: self.scene.add(selector.world_object)