From 18366df5d05c24f2ca5d27fb747983a065816c66 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 11 Jan 2023 12:03:08 +0800 Subject: [PATCH] ENH: only allow setting height when cut plane is horizontal Jira: STUDIO-1819 Change-Id: I04d258949cbf98a59f7313d714430f361bb2c4a9 (cherry picked from commit 2ffa8430b819cfffe20f4c7734125a3aabd33202) --- src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp index d92717ed5..c8e9e8470 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp @@ -497,6 +497,9 @@ void GLGizmoAdvancedCut::on_render_input_window(float x, float y, float bottom_l double height = m_height; ImGui::PushItemWidth(caption_size); ImGui::AlignTextToFramePadding(); + // only allow setting height when cut plane is horizontal + Vec3d plane_normal = get_plane_normal(); + m_imgui->disabled_begin(std::abs(plane_normal(0)) > EPSILON || std::abs(plane_normal(1)) > EPSILON); m_imgui->text(_L("Height") + " "); ImGui::SameLine(caption_size + 1 * space_size); ImGui::PushItemWidth(3 * unit_size + 2 * space_size); @@ -513,6 +516,7 @@ void GLGizmoAdvancedCut::on_render_input_window(float x, float y, float bottom_l m_buffered_height = height; } ImGui::PopStyleVar(1); + m_imgui->disabled_end(); ImGui::Separator(); // Part selection m_imgui->bbl_checkbox(_L("Keep upper part"), m_keep_upper);