From 558eb037d955db17162a18ebdf41f68646c10b63 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Thu, 11 Apr 2024 17:57:43 +0800 Subject: [PATCH] FIX: active_inst is -1 cause crashed by "return" button jira: none Change-Id: I3ce1725b671c3dc5e7321385010b219b3af99e6f --- src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp b/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp index 13d1cff54..56d251170 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosCommon.cpp @@ -468,8 +468,10 @@ void ObjectClipper::set_position(double pos, bool keep_normal) const ModelObject *mo = get_pool()->selection_info()->model_object(); int active_inst = get_pool()->selection_info()->get_active_instance(); double z_shift = get_pool()->selection_info()->get_sla_shift(); - - Vec3d normal = (keep_normal && m_clp) ? m_clp->get_normal() : -wxGetApp().plater()->get_camera().get_dir_forward(); + if (active_inst < 0) { + return; + } + Vec3d normal = (keep_normal && m_clp) ? m_clp->get_normal() : -wxGetApp().plater()->get_camera().get_dir_forward(); Vec3d center; if (get_pool()->get_canvas()->get_canvas_type() == GLCanvas3D::CanvasAssembleView) { const SelectionInfo *sel_info = get_pool()->selection_info();