Handle configuration files saved while there was no extruder_offset control for the first extruder

This commit is contained in:
Alessandro Ranellucci 2012-08-09 19:57:49 +02:00
parent d02012e4a3
commit 8289692160
2 changed files with 2 additions and 2 deletions

View File

@ -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' => {

View File

@ -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]);
};