diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index c6520f3c7..bc328c029 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -95,7 +95,7 @@ void PartPlate::load_render_colors() PartPlate::PartPlate() - : ObjectBase(-1), m_plater(nullptr), m_model(nullptr), m_quadric(nullptr),last_bed_type(BedType::btCount) + : ObjectBase(-1), m_plater(nullptr), m_model(nullptr), m_quadric(nullptr) { assert(this->id().invalid()); init(); @@ -166,25 +166,15 @@ void PartPlate::set_bed_type(BedType bed_type) assert(m_plater != nullptr); // update slice state - if (last_bed_type == BedType::btDefault){ - if (bed_type != BedType::btDefault) { - // get global bed type - BedType global_bed_type = wxGetApp().preset_bundle->project_config.opt_enum("curr_bed_type"); - if (global_bed_type != bed_type) - update_slice_result_valid_state(false); - } + BedType old_real_bed_type = get_bed_type(); + BedType new_real_bed_type = bed_type; + if (bed_type == BedType::btDefault) { + DynamicConfig& proj_cfg = wxGetApp().preset_bundle->project_config; + if (proj_cfg.has(bed_type_key)) + new_real_bed_type = proj_cfg.opt_enum(bed_type_key); } - else{ - if (bed_type == BedType::btDefault) { - // get global bed type - BedType global_bed_type = wxGetApp().preset_bundle->project_config.opt_enum("curr_bed_type"); - if (last_bed_type != global_bed_type) - update_slice_result_valid_state(false); - } - else { - if (last_bed_type != bed_type) - update_slice_result_valid_state(false); - } + if (old_real_bed_type != new_real_bed_type) { + update_slice_result_valid_state(false); } if (bed_type == BedType::btDefault) @@ -192,8 +182,6 @@ void PartPlate::set_bed_type(BedType bed_type) else m_config.set_key_value("curr_bed_type", new ConfigOptionEnum(bed_type)); - last_bed_type = bed_type; - if (m_plater) m_plater->update_project_dirty_from_presets(); } diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index 8bf5a490f..9bbffd8ce 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -213,7 +213,6 @@ public: //clear alll the instances in plate void clear(bool clear_sliced_result = true); - BedType last_bed_type; BedType get_bed_type(bool check_global = true) const; void set_bed_type(BedType bed_type); void reset_bed_type();