diff --git a/src/slic3r/GUI/Gizmos/GLGizmoScale.cpp b/src/slic3r/GUI/Gizmos/GLGizmoScale.cpp index 255d3a232..849d665a2 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoScale.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoScale.cpp @@ -364,10 +364,16 @@ double GLGizmoScale3D::calc_ratio(const UpdateData& data) const Vec3d plane_vec = mouse_dir.cross(m_starting.plane_nromal); plane_normal = plane_vec.cross(m_starting.plane_nromal); } - + plane_normal = plane_normal.normalized(); // finds the intersection of the mouse ray with the plane that the drag point moves // use ray-plane intersection see i.e. https://en.wikipedia.org/wiki/Line%E2%80%93plane_intersection - Vec3d inters = GetIntersectionOfRayAndPlane(data.mouse_ray.a, mouse_dir, m_starting.drag_position, plane_normal.normalized()); + auto dot_value = (plane_normal.dot(mouse_dir)); + auto angle = Geometry::rad2deg(acos(dot_value)); + auto big_than_min_angle = abs(angle) < 95 && abs(angle) > 85; + if (big_than_min_angle) { + return 1; + } + Vec3d inters = GetIntersectionOfRayAndPlane(data.mouse_ray.a, mouse_dir, m_starting.drag_position, plane_normal); Vec3d inters_vec = inters - m_starting.drag_position;