diff options
author | bubnikv <bubnikv@gmail.com> | 2017-02-21 19:43:28 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-02-21 19:43:28 +0300 |
commit | d02ee5cf809b3e6df54d5f4bf8f9eb5236c21f55 (patch) | |
tree | bf31701b99a8412bdf7199775661d8ed66db761e /lib | |
parent | 6649888d1ce9293f938eeb215ddad42b0b3eafb6 (diff) |
By @lordofhyphens:
only re-zoom if we have a valid bounding box, avoid a divide by 0 error.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Slic3r/GUI/3DScene.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Slic3r/GUI/3DScene.pm b/lib/Slic3r/GUI/3DScene.pm index 13306d26c..aa2e9bca5 100644 --- a/lib/Slic3r/GUI/3DScene.pm +++ b/lib/Slic3r/GUI/3DScene.pm @@ -608,7 +608,8 @@ sub zoom_to_bounding_box { # bounding box my $max_size = max(@{$bb->size}) * 2; my $min_viewport_size = min($self->GetSizeWH); - $self->_zoom($min_viewport_size / $max_size); + # only re-zoom if we have a valid bounding box, avoid a divide by 0 error. + $self->_zoom($min_viewport_size / $max_size) if ($max_size != 0); # center view around bounding box center $self->_camera_target($bb->center); |