auto-center now ignore unprintable objects

supermerill/SuperSlicer#2008
This commit is contained in:
supermerill 2021-12-06 10:36:41 +01:00
parent 0fec9837f1
commit 3b2b5a43d5

View File

@ -369,7 +369,9 @@ bool Model::center_instances_around_point(const Vec2d &point)
{ {
BoundingBoxf3 bb; BoundingBoxf3 bb;
for (ModelObject *o : this->objects) for (ModelObject *o : this->objects)
if (o->printable) // only center around printable objects (note: seems always true right now)
for (size_t i = 0; i < o->instances.size(); ++ i) for (size_t i = 0; i < o->instances.size(); ++ i)
if (o->instances[i]->printable) // only center around printable instances
bb.merge(o->instance_bounding_box(i, false)); bb.merge(o->instance_bounding_box(i, false));
Vec2d shift2 = point - to_2d(bb.center()); Vec2d shift2 = point - to_2d(bb.center());