Fixed regression causing variable layer heights to be ignored. #2136

Conflicts:

	xs/xsp/my.map
This commit is contained in:
Alessandro Ranellucci 2014-07-01 19:49:15 +02:00
parent 65dbf75a54
commit d9dc2fda00
3 changed files with 15 additions and 8 deletions

View file

@ -47,7 +47,7 @@ sub PartsChanged {
sub PartSettingsChanged {
my ($self) = @_;
return $self->{parts}->PartSettingsChanged;
return $self->{parts}->PartSettingsChanged || $self->{layers}->LayersChanged;
}
package Slic3r::GUI::Plater::ObjectDialog::BaseTab;
@ -113,6 +113,8 @@ sub new {
}
}
$grid->AppendRows(1);
$self->{layers_changed} = 1;
});
$self->SetSizer($sizer);
@ -165,4 +167,9 @@ sub _get_ranges {
return sort { $a->[0] <=> $b->[0] } @ranges;
}
sub LayersChanged {
my ($self) = @_;
return $self->{layers_changed};
}
1;

View file

@ -4,7 +4,7 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 3;
use Test::More tests => 4;
{
my $model = Slic3r::Model->new;
@ -13,6 +13,10 @@ use Test::More tests => 3;
isa_ok $object->origin_translation, 'Slic3r::Pointf::Ref';
$object->origin_translation->translate(10,0);
is_deeply \@{$object->origin_translation}, [10,0], 'origin_translation is modified by ref';
my $lhr = [ [ 5, 10, 0.1 ] ];
$object->set_layer_height_ranges($lhr);
is_deeply $object->layer_height_ranges, $lhr, 'layer_height_ranges roundtrip';
}
__END__

View file

@ -343,14 +343,10 @@ T_LAYER_HEIGHT_RANGES
};
AV *rangeAV = newAV();
SV *rangeAV_ref = newRV_noinc((SV*)rangeAV);
sv_2mortal(rangeAV_ref);
av_extend(rangeAV, 2);
for (int j = 0; j < 3; ++j) {
SV *val = sv_newmortal();
sv_setnv(val, range_values[j]);
av_store(rangeAV, j, val);
av_store(rangeAV, j, newSVnv(range_values[j]));
}
av_store(av, i++, (SV*)rangeAV_ref);
av_store(av, i++, (SV*)newRV_noinc((SV*)rangeAV));
}