Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2017-02-21 19:43:28 +0300
committerbubnikv <bubnikv@gmail.com>2017-02-21 19:43:28 +0300
commitd02ee5cf809b3e6df54d5f4bf8f9eb5236c21f55 (patch)
treebf31701b99a8412bdf7199775661d8ed66db761e /lib
parent6649888d1ce9293f938eeb215ddad42b0b3eafb6 (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.pm3
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);