From 4bff4d0d508990845450144f54c71659d36c9402 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 15 Jan 2013 12:50:15 +0100 Subject: [PATCH] Ignore perimeter_acceleration and infill_acceleration if their values are 25 and 50 to handle legacy configs gracefully. --- lib/Slic3r/Config.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index d79fdf9c4..f691ae35b 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -1024,6 +1024,17 @@ sub set { $value = 1; } + # For historical reasons, the world's full of configs having these very low values; + # to avoid unexpected behavior we need to ignore them. Banning these two hard-coded + # values is a dirty hack and will need to be removed sometime in the future, but it + # will avoid lots of complaints for now. + if ($opt_key eq 'perimeter_acceleration' && $value == '25') { + $value = 0; + } + if ($opt_key eq 'infill_acceleration' && $value == '50') { + $value = 0; + } + if (!exists $Options->{$opt_key}) { my @keys = grep { $Options->{$_}{aliases} && grep $_ eq $opt_key, @{$Options->{$_}{aliases}} } keys %$Options; if (!@keys) {