From 72fe6d903ceed545fb0aeeeefa52732e257f3149 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 6 Dec 2013 19:34:50 +0100 Subject: [PATCH] Don't return the cached bounding box but clone it --- lib/Slic3r/Model.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Model.pm b/lib/Slic3r/Model.pm index 46e74da4a..6993fd35a 100644 --- a/lib/Slic3r/Model.pm +++ b/lib/Slic3r/Model.pm @@ -171,7 +171,7 @@ sub bounding_box { if (!defined $self->_bounding_box) { $self->_bounding_box(Slic3r::Geometry::BoundingBox->merge(map $_->bounding_box, @{$self->objects})); } - return $self->_bounding_box; + return $self->_bounding_box->clone; } sub align_to_origin { @@ -368,7 +368,7 @@ sub bounding_box { $bounding_box->merge(Slic3r::Geometry::BoundingBox->new_from_bb($_->bb3)) for @meshes; $self->_bounding_box($bounding_box); } - return $self->_bounding_box; + return $self->_bounding_box->clone; } sub align_to_origin {