Save the vector used for aligning object volumes to origin and apply it to additional parts added from the object part panel in order to make them coincide

This commit is contained in:
Alessandro Ranellucci 2014-04-02 20:23:26 +02:00
parent 017158c877
commit 45559f87f3
3 changed files with 7 additions and 2 deletions

View file

@ -309,6 +309,7 @@ has 'instances' => (is => 'rw');
has 'config' => (is => 'rw', default => sub { Slic3r::Config->new });
has 'layer_height_ranges' => (is => 'rw', default => sub { [] }); # [ z_min, z_max, layer_height ]
has '_bounding_box' => (is => 'rw');
has 'origin_translation' => (is => 'ro', default => sub { Slic3r::Point->new }); # translation vector applied by center_around_origin()
sub add_volume {
my $self = shift;
@ -446,6 +447,7 @@ sub center_around_origin {
$shift[Y] -= $size->y/2; #//
$self->translate(@shift);
$self->origin_translation->translate(@shift[X,Y]);
if (defined $self->instances) {
foreach my $instance (@{ $self->instances }) {