From 0e692f472dde2f01575d020a6534f9f98da82f7d Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Mon, 20 May 2024 16:53:14 +0800 Subject: [PATCH] FIX:modify range of camera horizontal angle is 9 degree when drag object jira:STUDIO-7087 Change-Id: Idd3141daa025cd9c57ba5a1c8df79c583eeb8ed4 --- src/slic3r/GUI/GLCanvas3D.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 024209301..d289d8d2f 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4240,7 +4240,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) // we do not want to translate objects if the user just clicked on an object while pressing shift to remove it from the selection and then drag if (m_selection.contains_volume(get_first_hover_volume_idx())) { const Camera& camera = wxGetApp().plater()->get_camera(); - if (std::abs(camera.get_dir_forward()(2)) < EPSILON) { + auto camera_up_down_rad_limit = abs(asin(camera.get_dir_forward()(2) / 1.0f)); + if (camera_up_down_rad_limit < PI/20.0f) { // side view -> move selected volumes orthogonally to camera view direction Linef3 ray = mouse_ray(pos); Vec3d dir = ray.unit_vector();