From 7335f5d015a3cf3fde85724be6380cf950e2dbf4 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Sat, 28 Jan 2023 10:59:07 +0800 Subject: [PATCH] FIX: fix the crash issue when switch timelapse_mode or spiral mode previous commit only fix the crash when switch spiral_mode and will cause crash when switch timelapse_mode Change-Id: If21acf3701e9519de55a08e183620678378f61b9 --- src/slic3r/GUI/ConfigManipulation.cpp | 5 +++-- src/slic3r/GUI/Tab.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 648821e254..812883fc6c 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -159,7 +159,7 @@ void ConfigManipulation::check_filament_max_volumetric_speed(DynamicPrintConfig apply(config, &new_conf); is_msg_dlg_already_exist = false; } - + } void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config) @@ -311,7 +311,8 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con apply(config, &new_conf); if (cb_value_change) { cb_value_change("sparse_infill_density", sparse_infill_density); - cb_value_change("timelapse_type", timelapse_type); + int timelapse_type_int = (int)timelapse_type; + cb_value_change("timelapse_type", timelapse_type_int); if (!support) cb_value_change("enable_support", false); } diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index e74ed65a84..9db47a968e 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1402,7 +1402,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) // reload scene to update timelapse wipe tower if (opt_key == "timelapse_type") { bool wipe_tower_enabled = m_config->option("enable_prime_tower")->value; - if (!wipe_tower_enabled && boost::any_cast(value) == TimelapseType::tlSmooth) { + if (!wipe_tower_enabled && boost::any_cast(value) == (int)TimelapseType::tlSmooth) { MessageDialog dlg(wxGetApp().plater(), _L("Prime tower is required for smooth timelapse. There may be flaws on the model without prime tower. Do you want to enable prime tower?"), _L("Warning"), wxICON_WARNING | wxYES | wxNO); if (dlg.ShowModal() == wxID_YES) {