mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
Fixed division by zero in get_zoom_to_bounding_box_factor on Linux
This commit is contained in:
parent
fd16357b6e
commit
a4df0bdcc3
1 changed files with 3 additions and 4 deletions
|
@ -687,10 +687,7 @@ sub select_view {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub get_zoom_to_bounding_box_factor {
|
sub get_zoom_to_bounding_box_factor {
|
||||||
my ($self, $bb) = @_;
|
my ($self, $bb) = @_;
|
||||||
|
|
||||||
return undef if (! $self->init);
|
|
||||||
|
|
||||||
my $max_bb_size = max(@{ $bb->size });
|
my $max_bb_size = max(@{ $bb->size });
|
||||||
return undef if ($max_bb_size == 0);
|
return undef if ($max_bb_size == 0);
|
||||||
|
|
||||||
|
@ -763,6 +760,8 @@ sub get_zoom_to_bounding_box_factor {
|
||||||
$max_y = max($max_y, $margin_factor * 2 * abs($y_on_plane));
|
$max_y = max($max_y, $margin_factor * 2 * abs($y_on_plane));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return undef if (($max_x == 0) || ($max_y == 0));
|
||||||
|
|
||||||
my ($cw, $ch) = $self->GetSizeWH;
|
my ($cw, $ch) = $self->GetSizeWH;
|
||||||
my $min_ratio = min($cw / $max_x, $ch / $max_y);
|
my $min_ratio = min($cw / $max_x, $ch / $max_y);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue