diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index e089621f2..863c793e3 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3497,13 +3497,14 @@ void GLCanvas3D::do_rotate(const std::string& snapshot_type) // Fixes sinking/flying instances for (const std::pair& i : done) { ModelObject* m = m_model->objects[i.first]; - double shift_z = m->get_instance_min_z(i.second); + const double shift_z = m->get_instance_min_z(i.second); // leave sinking instances as sinking if (min_zs.empty() || min_zs.find({ i.first, i.second })->second >= SINKING_Z_THRESHOLD || shift_z > SINKING_Z_THRESHOLD) { - Vec3d shift(0.0, 0.0, -shift_z); + const Vec3d shift(0.0, 0.0, -shift_z); m_selection.translate(i.first, i.second, shift); m->translate_instance(i.second, shift); } + wxGetApp().obj_list()->update_info_items(static_cast(i.first)); } @@ -3861,6 +3862,15 @@ void GLCanvas3D::update_sequential_clearance() set_sequential_print_clearance_polygons(polygons); } +bool GLCanvas3D::is_object_sinking(int object_idx) const +{ + for (const GLVolume* v : m_volumes.volumes) { + if (v->object_idx() == object_idx && v->is_sinking()) + return true; + } + return false; +} + bool GLCanvas3D::_is_shown_on_screen() const { return (m_canvas != nullptr) ? m_canvas->IsShownOnScreen() : false; diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index d190c0819..6e7c26959 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -875,6 +875,8 @@ public: void reset_old_size() { m_old_size = { 0, 0 }; } + bool is_object_sinking(int object_idx) const; + private: bool _is_shown_on_screen() const; diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 834e45898..a4bfd3f46 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2558,9 +2558,8 @@ void ObjectList::update_info_items(size_t obj_idx) break; case InfoItemType::Sinking: { - const BoundingBoxf3& box = model_object->bounding_box(); should_show = printer_technology() == ptFFF && - box.min.z() < SINKING_Z_THRESHOLD && box.max.z() > SINKING_Z_THRESHOLD; + wxGetApp().plater()->canvas3D()->is_object_sinking(obj_idx); break; } default: break;