Fixed regression preventing SVG export to work properly. #428

This commit is contained in:
Alessandro Ranellucci 2012-06-11 13:50:38 +02:00
parent 71c1c66985
commit 1f35a3f6aa

View File

@ -363,12 +363,11 @@ EOF
my @layers = map $_->layers->[$layer_id], @{$self->objects}; my @layers = map $_->layers->[$layer_id], @{$self->objects};
printf $fh qq{ <g id="layer%d" slic3r:z="%s">\n}, $layer_id, unscale +(grep defined $_, @layers)[0]->slice_z; printf $fh qq{ <g id="layer%d" slic3r:z="%s">\n}, $layer_id, unscale +(grep defined $_, @layers)[0]->slice_z;
for my $obj_idx (0 .. $#layers) { for my $obj_idx (0 .. $#{$self->objects}) {
my $layer = $layers[$layer_id] or next; my $layer = $self->objects->[$obj_idx]->layers->[$layer_id] or next;
# sort slices so that the outermost ones come first # sort slices so that the outermost ones come first
my @slices = sort { $a->expolygon->contour->encloses_point($b->expolygon->contour->[0]) ? 0 : 1 } @{$layer->slices}; my @slices = sort { $a->expolygon->contour->encloses_point($b->expolygon->contour->[0]) ? 0 : 1 } @{$layer->slices};
foreach my $copy (@{$self->copies->[$obj_idx]}) { foreach my $copy (@{$self->copies->[$obj_idx]}) {
foreach my $slice (@slices) { foreach my $slice (@slices) {
my $expolygon = $slice->expolygon->clone; my $expolygon = $slice->expolygon->clone;