From 5b03c19bae012d6e581cbdb9477de725725ed219 Mon Sep 17 00:00:00 2001 From: supermerill Date: Tue, 9 Nov 2021 11:42:06 +0100 Subject: [PATCH] fix min/max layer height loading check. supermerill/SuperSlicer#1832 --- src/slic3r/GUI/Tab.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index fc789adbd..1236efa08 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3079,20 +3079,20 @@ void TabPrinter::toggle_options() const std::vector& min_layer_height = m_config->option("min_layer_height")->values; for (int i = 0; i < min_layer_height.size(); i++) { if(!min_layer_height[i].percent) - if (min_layer_height[i].get_abs_value(nozzle_diameters[i]) != 0 && (int64_t)(min_layer_height[i].get_abs_value(nozzle_diameters[i]) * 1000000.) % z_step_Mlong != 0) { + if (min_layer_height[i].value != 0 && (int64_t)(min_layer_height[i].value * 1000000.) % z_step_Mlong != 0) { if (!has_changed) new_conf = *m_config; - new_conf.option("min_layer_height")->values[i] = FloatOrPercent{ std::max(z_step, Slic3r::check_z_step(min_layer_height[i].get_abs_value(nozzle_diameters[i]), z_step)), false }; + new_conf.option("min_layer_height")->values[i].value = std::max(z_step, Slic3r::check_z_step(min_layer_height[i].value, z_step)); has_changed = true; } } std::vector max_layer_height = m_config->option("max_layer_height")->values; for (int i = 0; i < max_layer_height.size(); i++) { if (!max_layer_height[i].percent) - if ((int64_t)(max_layer_height[i].get_abs_value(nozzle_diameters[i]) * 1000000.) % z_step_Mlong != 0) { + if ((int64_t)(max_layer_height[i].value * 1000000.) % z_step_Mlong != 0) { if (!has_changed) new_conf = *m_config; - new_conf.option("max_layer_height")->values[i] = FloatOrPercent{ std::max(z_step, Slic3r::check_z_step(new_conf.option("max_layer_height")->values[i], z_step)), false }; + new_conf.option("max_layer_height")->values[i].value = std::max(z_step, Slic3r::check_z_step(max_layer_height[i].value, z_step)); has_changed = true; } }