From 91462cf9d5ef9a34752bbdb6ceff330a10bbffad Mon Sep 17 00:00:00 2001 From: Filip Sykala Date: Mon, 4 Oct 2021 09:23:06 +0200 Subject: [PATCH] Fix wireframe transformation when supports in SLA are added --- src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp index 52e65f1b6..9e4c71d2f 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp @@ -478,12 +478,14 @@ void GLGizmoSimplify::render_wireframe() const // is initialized? if (m_wireframe_VBO_id == 0 || m_wireframe_IBO_id == 0) return; if (!m_show_wireframe) return; - ModelVolume *act_volume = get_selected_volume(); - if (act_volume == nullptr) return; - const Transform3d trafo_matrix = - act_volume->get_object()->instances[m_parent.get_selection().get_instance_idx()] - ->get_transformation().get_matrix() * - act_volume->get_matrix(); + + const GLVolume *selected_volume = m_parent.get_selection().get_volume(0); + + // check selected_volume == act_volume + const auto& cid = selected_volume->composite_id; + assert(wxGetApp().plater()->model().objects[cid.object_id]->volumes[cid.volume_id] == act_volume); + + const Transform3d trafo_matrix = m_parent.get_selection().get_volume(0)->world_matrix(); glsafe(::glPushMatrix()); glsafe(::glMultMatrixd(trafo_matrix.data()));