mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-07 07:19:06 +08:00
By @lordofhyphens:
only re-zoom if we have a valid bounding box, avoid a divide by 0 error.
This commit is contained in:
parent
6649888d1c
commit
d02ee5cf80
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user