From 71057b54a95f99ccceb8c5044b8b37f990a1a5fd Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 3 Jul 2013 10:51:44 +0200 Subject: [PATCH] Allow negative values in validation... --- lib/Slic3r/Config.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 0ef9b7803..a6f86e16f 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -1357,8 +1357,8 @@ sub validate { foreach my $value (@values) { if ($type eq 'i' || $type eq 'f') { die "Invalid value for $opt_key\n" - if ($type eq 'i' && $value !~ /^\d+$/) - || ($type eq 'f' && $value !~ /^(?:\d+|\d*\.\d+)$/) + if ($type eq 'i' && $value !~ /^-?\d+$/) + || ($type eq 'f' && $value !~ /^-?(?:\d+|\d*\.\d+)$/) || (defined $opt->{min} && $value < $opt->{min}) || (defined $opt->{max} && $value > $opt->{max}); } elsif ($type eq 's' && $opt->{type} eq 'select') {