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