From 8289692160c34d8845560eb27175a8d7a710d9d9 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 9 Aug 2012 19:57:49 +0200 Subject: [PATCH] Handle configuration files saved while there was no extruder_offset control for the first extruder --- lib/Slic3r/Config.pm | 2 +- lib/Slic3r/GUI/OptionsGroup.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index a0863ef8c..1cee4503a 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -120,7 +120,7 @@ our $Options = { cli => 'extruder-offset=s@', type => 'point', serialize => sub { join ',', map { join 'x', @$_ } @{$_[0]} }, - deserialize => sub { [ map [ split /x/, $_ ], (ref $_[0] eq 'ARRAY') ? @{$_[0]} : (split /,/, $_[0]) ] }, + deserialize => sub { [ map [ split /x/, $_ ], (ref $_[0] eq 'ARRAY') ? @{$_[0]} : (split /,/, $_[0] || '0x0') ] }, default => [[0,0]], }, 'nozzle_diameter' => { diff --git a/lib/Slic3r/GUI/OptionsGroup.pm b/lib/Slic3r/GUI/OptionsGroup.pm index de056cb8a..b7c562dc2 100644 --- a/lib/Slic3r/GUI/OptionsGroup.pm +++ b/lib/Slic3r/GUI/OptionsGroup.pm @@ -115,7 +115,7 @@ sub BUILD { } EVT_TEXT($self->parent, $_, sub { $self->_on_change($opt_key, [ $x_field->GetValue, $y_field->GetValue ]) }) for $x_field, $y_field; - $self->_setters->{$opt_key} = sub { + $self->_setters->{$opt_key} = sub {use XXX; ZZZ $_[0] if !defined $_[0][0]; $x_field->SetValue($_[0][0]); $y_field->SetValue($_[0][1]); };