mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 01:15:52 +08:00
Use last extruder's settings when adding new ones. #1997
This commit is contained in:
parent
0ba685f556
commit
85b0a4376a
@ -743,7 +743,13 @@ sub _build_extruder_pages {
|
|||||||
# extend options
|
# extend options
|
||||||
foreach my $opt_key ($self->_extruder_options) {
|
foreach my $opt_key ($self->_extruder_options) {
|
||||||
my $values = $self->{config}->get($opt_key);
|
my $values = $self->{config}->get($opt_key);
|
||||||
$values->[$extruder_idx] //= $default_config->get_at($opt_key, 0);
|
if (!defined $values) {
|
||||||
|
$values = [ $default_config->get_at($opt_key, 0) ];
|
||||||
|
} else {
|
||||||
|
# use last extruder's settings for the new one
|
||||||
|
my $last_value = $values->[-1];
|
||||||
|
$values->[$extruder_idx] //= $last_value;
|
||||||
|
}
|
||||||
$self->{config}->set($opt_key, $values)
|
$self->{config}->set($opt_key, $values)
|
||||||
or die "Unable to extend $opt_key";
|
or die "Unable to extend $opt_key";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user