From 9a0ef5b98914db3d73ab02186b6c6f50e2e64bbc Mon Sep 17 00:00:00 2001 From: "yifan.wu" Date: Thu, 24 Nov 2022 14:15:41 +0800 Subject: [PATCH] FIX: fix a bed texture not display issue 1. change default bed_type to "1" in app_config 2. if old app_config.bed_type is 0, change it to 1 Signed-off-by: yifan.wu Change-Id: I9923187ab480b0a4991bfbc13892bfb43b2a990b --- src/libslic3r/AppConfig.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index cc7a65e99..cbc3d6f2c 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -290,7 +290,7 @@ void AppConfig::set_defaults() } if (get("curr_bed_type").empty()) { - set("curr_bed_type", "0"); + set("curr_bed_type", "1"); } #if BBL_RELEASE_TO_PUBLIC diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index a6b6c2522..dd5340f09 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -571,7 +571,14 @@ Sidebar::Sidebar(Plater *parent) AppConfig *app_config = wxGetApp().app_config; std::string str_bed_type = app_config->get("curr_bed_type"); int bed_type_value = atoi(str_bed_type.c_str()); - m_bed_type_list->Select(bed_type_value); + // hotfix: btDefault is added as the first one in BedType, and app_config should not be btDefault + if (bed_type_value == 0) { + app_config->set("curr_bed_type", "1"); + bed_type_value = 1; + } + + int bed_type_idx = bed_type_value - 1; + m_bed_type_list->Select(bed_type_idx); bed_type_sizer->Add(bed_type_title, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(10)); bed_type_sizer->Add(m_bed_type_list, 1, wxLEFT | wxRIGHT | wxEXPAND, FromDIP(10)); vsizer_printer->Add(bed_type_sizer, 0, wxEXPAND | wxTOP, FromDIP(5));