From aa82c67e5fd5efab1c1cec9a721ce2e44231f724 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Tue, 25 Apr 2023 08:53:36 +0800 Subject: [PATCH] FIX:Change Camera for support, coloring, and z-stitching Using the same camera as the assembly drawing for support, coloring, and z-stitching Change-Id: I2f9a5724e43cd10a30658e742ed7986e49958668 (cherry picked from commit 8fd0d3e342b329fae93150677677565ec7c04a05) --- src/slic3r/GUI/GLCanvas3D.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index cf20dde46..a62595899 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4144,7 +4144,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) // if dragging over blank area with left button, rotate if ((any_gizmo_active || m_hover_volume_idxs.empty()) && m_mouse.is_start_position_3D_defined()) { const Vec3d rot = (Vec3d(pos.x(), pos.y(), 0.) - m_mouse.drag.start_position_3D) * (PI * TRACKBALLSIZE / 180.); - if (this->m_canvas_type == ECanvasType::CanvasAssembleView) { + if (this->m_canvas_type == ECanvasType::CanvasAssembleView || m_gizmos.get_current_type() == GLGizmosManager::FdmSupports || + m_gizmos.get_current_type() == GLGizmosManager::Seam || m_gizmos.get_current_type() == GLGizmosManager::MmuSegmentation) { //BBS rotate around target Camera& camera = wxGetApp().plater()->get_camera(); Vec3d rotate_target = Vec3d::Zero(); @@ -4174,13 +4175,14 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) camera.recover_from_free_camera(); //BBS modify rotation - if (m_gizmos.get_current_type() == GLGizmosManager::FdmSupports - || m_gizmos.get_current_type() == GLGizmosManager::Seam - || m_gizmos.get_current_type() == GLGizmosManager::MmuSegmentation) { - //camera.rotate_local_with_target(Vec3d(rot.y(), rot.x(), 0.), rotate_target); - camera.rotate_on_sphere_with_target(rot.x(), rot.y(), rotate_limit, rotate_target); - } - else if (evt.ControlDown() || evt.CmdDown()) { + //if (m_gizmos.get_current_type() == GLGizmosManager::FdmSupports + // || m_gizmos.get_current_type() == GLGizmosManager::Seam + // || m_gizmos.get_current_type() == GLGizmosManager::MmuSegmentation) { + // //camera.rotate_local_with_target(Vec3d(rot.y(), rot.x(), 0.), rotate_target); + // //camera.rotate_on_sphere_with_target(rot.x(), rot.y(), rotate_limit, rotate_target); + //} + //else + if (evt.ControlDown() || evt.CmdDown()) { if ((m_rotation_center.x() == 0.f) && (m_rotation_center.y() == 0.f) && (m_rotation_center.z() == 0.f)) { auto canvas_w = float(get_canvas_size().get_width()); auto canvas_h = float(get_canvas_size().get_height());