From e66632a595f5591e87c5f6c4cb6ec82bb12b0574 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 7 Feb 2020 14:03:55 +0100 Subject: [PATCH] Hollowing parameters should be labeled the same in the gizmo and in presets --- src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp | 41 ++++++++++++++----------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index 87a4960ee..459038692 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -676,6 +676,29 @@ void GLGizmoHollow::on_render_input_window(float x, float y, float bottom_limit) bool first_run = true; // This is a hack to redraw the button when all points are removed, // so it is not delayed until the background process finishes. + + std::vector opts_keys = {"hollowing_min_thickness", "hollowing_quality", "hollowing_closing_distance"}; + auto opts = get_config_options(opts_keys); + auto* offset_cfg = static_cast(opts[0].first); + float offset = offset_cfg->value; + double offset_min = opts[0].second->min; + double offset_max = opts[0].second->max; + + auto* quality_cfg = static_cast(opts[1].first); + float quality = quality_cfg->value; + double quality_min = opts[1].second->min; + double quality_max = opts[1].second->max; + + auto* closing_d_cfg = static_cast(opts[2].first); + float closing_d = closing_d_cfg->value; + double closing_d_min = opts[2].second->min; + double closing_d_max = opts[2].second->max; + + m_desc["offset"] = _(opts[0].second->label).ToUTF8() + wxString(":"); + m_desc["quality"] = _(opts[1].second->label).ToUTF8() + wxString(":"); + m_desc["closing_distance"] = _(opts[2].second->label).ToUTF8() + wxString(":"); + + RENDER_AGAIN: const float approx_height = m_imgui->scaled(20.0f); y = std::min(y, bottom_limit - approx_height); @@ -718,24 +741,6 @@ RENDER_AGAIN: m_imgui->disabled_begin(! m_enable_hollowing); - std::vector opts_keys = {"hollowing_min_thickness", "hollowing_quality", "hollowing_closing_distance"}; - auto opts = get_config_options(opts_keys); - auto* offset_cfg = static_cast(opts[0].first); - float offset = offset_cfg->value; - double offset_min = opts[0].second->min; - double offset_max = opts[0].second->max; - - auto* quality_cfg = static_cast(opts[1].first); - float quality = quality_cfg->value; - double quality_min = opts[1].second->min; - double quality_max = opts[1].second->max; - - auto* closing_d_cfg = static_cast(opts[2].first); - float closing_d = closing_d_cfg->value; - double closing_d_min = opts[2].second->min; - double closing_d_max = opts[2].second->max; - - m_imgui->text(m_desc.at("offset")); ImGui::SameLine(settings_sliders_left); ImGui::PushItemWidth(window_width - settings_sliders_left);