From bbb2080cb2cd8f14e778b76c0ac827a43c18c785 Mon Sep 17 00:00:00 2001 From: supermerill Date: Wed, 20 Dec 2023 14:28:39 +0100 Subject: [PATCH] Fix Crash when adding custom printer as printer or second printer supermerill/SuperSlicer#3977 --- src/libslic3r/PrintConfig.cpp | 2 +- src/slic3r/GUI/ConfigWizard.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index d5bbbf7f7fd..ed632aa99a5 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -4117,7 +4117,7 @@ void PrintConfigDef::init_fff_params() "\nset 0 to disable"); def->sidetext = L("mm or %"); def->mode = comExpert | comSuSi; - def->set_default_value(new ConfigOptionFloatOrPercent(false, 0)); + def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); def = this->add("perimeter_fan_speed", coInts); def->label = L("Internal Perimeter fan speed"); diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 5c718f8021f..8bc942a6180 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -1558,10 +1558,10 @@ void PageDiameters::apply_custom_config(DynamicPrintConfig &config) config.option("infill_extrusion_width")->set_phony(true); config.option("solid_infill_extrusion_width")->set_phony(true); config.option("top_infill_extrusion_width")->set_phony(true); - config.set_key_value("perimeter_extrusion_change_odd_layers", new ConfigOptionFloat(0)); - config.set_key_value("external_perimeter_extrusion_change_odd_layers", new ConfigOptionFloat(0)); - config.set_key_value("infill_extrusion_change_odd_layers", new ConfigOptionFloat(0)); - config.set_key_value("solid_infill_extrusion_change_odd_layers", new ConfigOptionFloat(0)); + config.set_key_value("perimeter_extrusion_change_odd_layers", new ConfigOptionFloatOrPercent(0, false)); + config.set_key_value("external_perimeter_extrusion_change_odd_layers", new ConfigOptionFloatOrPercent(0, false)); + config.set_key_value("infill_extrusion_change_odd_layers", new ConfigOptionFloatOrPercent(0, false)); + config.set_key_value("solid_infill_extrusion_change_odd_layers", new ConfigOptionFloatOrPercent(0, false)); config.update_phony({}); }