From 3719059c396bd5a3b1af491945a556a468dd0ffd Mon Sep 17 00:00:00 2001 From: "jun.zhang" Date: Wed, 12 Mar 2025 19:31:17 +0800 Subject: [PATCH] FIX: GizmoScale3D jira: no-jira Change-Id: I486e10e3241de6ae8a8a350f424d05a4ce0f17b8 --- src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp b/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp index 931f240cd..d49921450 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp @@ -99,8 +99,10 @@ void GLGizmoRotate::on_update(const UpdateData& data) double len = mouse_pos.norm(); + const auto& scale_factor = Geometry::Transformation(m_base_model_matrix).get_scaling_factor(); + const float radius = scale_factor.maxCoeff()* m_radius; // snap to coarse snap region - if ((m_snap_coarse_in_radius <= len) && (len <= m_snap_coarse_out_radius)) + if ((m_snap_coarse_in_radius * radius <= len) && (len <= m_snap_coarse_out_radius * radius)) { double step = 2.0 * (double)PI / (double)SnapRegionsCount; theta = step * (double)std::round(theta / step); @@ -108,7 +110,7 @@ void GLGizmoRotate::on_update(const UpdateData& data) else { // snap to fine snap region (scale) - if ((m_snap_fine_in_radius <= len) && (len <= m_snap_fine_out_radius)) + if ((m_snap_fine_in_radius * radius <= len) && (len <= m_snap_fine_out_radius * radius)) { double step = 2.0 * (double)PI / (double)ScaleStepsCount; theta = step * (double)std::round(theta / step);