Fixed autoscale of objects after loading

This commit is contained in:
Enrico Turri 2018-04-10 13:39:10 +02:00
parent a81f78045b
commit b961711f28

View File

@ -737,7 +737,7 @@ sub load_model_objects {
{ {
# if the object is too large (more than 5 times the bed), scale it down # if the object is too large (more than 5 times the bed), scale it down
my $size = $o->bounding_box->size; my $size = $o->bounding_box->size;
my $ratio = max(@$size[X,Y]) / unscale(max(@$bed_size[X,Y])); my $ratio = max($size->x / unscale($bed_size->x), $size->y / unscale($bed_size->y));
if ($ratio > 5) { if ($ratio > 5) {
$_->set_scaling_factor(1/$ratio) for @{$o->instances}; $_->set_scaling_factor(1/$ratio) for @{$o->instances};
$scaled_down = 1; $scaled_down = 1;