diff --git a/src/slic3r/GUI/ObjColorDialog.cpp b/src/slic3r/GUI/ObjColorDialog.cpp index 5d9e2e8cad..3b761dfabf 100644 --- a/src/slic3r/GUI/ObjColorDialog.cpp +++ b/src/slic3r/GUI/ObjColorDialog.cpp @@ -232,12 +232,18 @@ ObjColorDialog::ObjColorDialog(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, if (this->FindWindowById(wxID_CANCEL, this)) { update_ui(static_cast(this->FindWindowById(wxID_CANCEL, this))); this->FindWindowById(wxID_CANCEL, this)->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { - if (!m_panel_ObjColor) { return; } - m_panel_ObjColor->cancel_paint_color(); - EndModal(wxCANCEL); + if (m_panel_ObjColor) { + m_panel_ObjColor->cancel_paint_color(); + } + EndModal(wxCANCEL); }); } - this->Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent& e) { EndModal(wxCANCEL); }); + this->Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent &e) { + if (m_panel_ObjColor) { + m_panel_ObjColor->cancel_paint_color(); + } + EndModal(wxCANCEL); + }); wxGetApp().UpdateDlgDarkUI(this); CenterOnParent(); @@ -488,6 +494,7 @@ void ObjColorPanel::cancel_paint_color() { auto mv = mo->volumes[0]; mv->mmu_segmentation_facets.reset(); mv->config.set("extruder", 1); + m_first_extruder_id = 1; } void ObjColorPanel::update_filament_ids() diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 0a49eb4f61..2fcda18e70 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -1776,11 +1776,15 @@ bool PartPlate::check_mixture_of_pla_and_petg(const DynamicPrintConfig &config) if (!used_filaments.empty()) { for (auto filament_idx : used_filaments) { int filament_id = filament_idx - 1; - std::string filament_type = config.option("filament_type")->values.at(filament_id); - if (filament_type == "PLA") - has_pla = true; - if (filament_type == "PETG") - has_petg = true; + if (filament_id < config.option("filament_type")->values.size()) { + std::string filament_type = config.option("filament_type")->values.at(filament_id); + if (filament_type == "PLA") + has_pla = true; + if (filament_type == "PETG") + has_petg = true; + } else { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " check error:array bound"; + } } }