From 8a44a754ca9dd3a7ee57f4e8383e30189f8894d6 Mon Sep 17 00:00:00 2001 From: Filip Sykala Date: Mon, 22 Nov 2021 09:10:39 +0100 Subject: [PATCH] Fix glmodel initialization --- src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp index b725a6e48..653ae9fe0 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp @@ -628,19 +628,17 @@ void GLGizmoSimplify::init_model() // set actual triangle count m_triangle_count += its.indices.size(); - auto item = std::make_pair( + m_glmodels.emplace_back( GLVolume::CompositeID(cid.object_id, cid.volume_id, cid.instance_id), // copy GLModel()); - - GLModel &glmodel = item.second; + GLModel &glmodel = m_glmodels.back().second; + //glmodel.reset(); glmodel.init_from(its); glmodel.set_color(-1,selected_volume->color); m_parent.toggle_model_objects_visibility(false, info->model_object(), info->get_active_instance(), volume); - - m_glmodels.emplace_back(item); } }