reset exclude_area

This commit is contained in:
sunsets
2024-03-18 14:11:10 +08:00
parent 9d43e47a54
commit 0401c46f99
2 changed files with 6 additions and 1 deletions

View File

@@ -618,7 +618,11 @@ void ConfigOptionsGroup::back_to_sys_value(const std::string& opt_key)
void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config, const std::string& opt_key) void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config, const std::string& opt_key)
{ {
boost::any value; boost::any value;
//B52
if (opt_key == "bed_shape") { if (opt_key == "bed_shape") {
value = get_config_value(config, "bed_exclude_area");
this->change_opt_value("bed_exclude_area", value);
OptionsGroup::on_change_OG("bed_exclude_area", value);
for (const std::string& key : {"bed_custom_texture", "bed_custom_model"}) { for (const std::string& key : {"bed_custom_texture", "bed_custom_model"}) {
value = config.opt_string(key); value = config.opt_string(key);
this->change_opt_value(key, value); this->change_opt_value(key, value);

View File

@@ -629,8 +629,9 @@ void Tab::update_changed_ui()
{ {
auto check_bed_custom_options = [](std::vector<std::string>& keys) { auto check_bed_custom_options = [](std::vector<std::string>& keys) {
size_t old_keys_size = keys.size(); size_t old_keys_size = keys.size();
//B52
keys.erase(std::remove_if(keys.begin(), keys.end(), [](const std::string& key) { keys.erase(std::remove_if(keys.begin(), keys.end(), [](const std::string& key) {
return key == "bed_custom_texture" || key == "bed_custom_model"; }), keys.end()); return key == "bed_custom_texture" || key == "bed_custom_model" || key == "bed_exclude_area"; }), keys.end());
if (old_keys_size != keys.size() && std::find(keys.begin(), keys.end(), "bed_shape") == keys.end()) if (old_keys_size != keys.size() && std::find(keys.begin(), keys.end(), "bed_shape") == keys.end())
keys.emplace_back("bed_shape"); keys.emplace_back("bed_shape");
}; };