mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06: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
1 changed files with 2 additions and 1 deletions
|
@ -608,7 +608,8 @@ sub zoom_to_bounding_box {
|
||||||
# bounding box
|
# bounding box
|
||||||
my $max_size = max(@{$bb->size}) * 2;
|
my $max_size = max(@{$bb->size}) * 2;
|
||||||
my $min_viewport_size = min($self->GetSizeWH);
|
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
|
# center view around bounding box center
|
||||||
$self->_camera_target($bb->center);
|
$self->_camera_target($bb->center);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue