Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2018-04-23 12:52:03 +0300
committerYuSanka <yusanka@gmail.com>2018-04-23 12:52:03 +0300
commitec7e10e068f1b8d587ede2028aa43abd13869593 (patch)
treeb2388874d0e434d20967b0bf092a235494a3c5ba /xs/src/slic3r/GUI/Tab.cpp
parent9a1dbfa6cf4fbef9c9ad92972f23aa246c9d6701 (diff)
Fixed wrong behavior of options group Tree after extruders count change
Diffstat (limited to 'xs/src/slic3r/GUI/Tab.cpp')
-rw-r--r--xs/src/slic3r/GUI/Tab.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp
index e15767329..3ad40d9f7 100644
--- a/xs/src/slic3r/GUI/Tab.cpp
+++ b/xs/src/slic3r/GUI/Tab.cpp
@@ -1348,6 +1348,9 @@ void TabPrinter::build()
m_presets = &m_preset_bundle->printers;
load_initial_data();
+ // to avoid redundant memory allocation / deallocation during extruders count changing
+ m_pages.reserve(30);
+
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(m_config->option("nozzle_diameter"));
m_initial_extruders_count = m_extruders_count = nozzle_diameter->values.size();
const Preset* parent_preset = m_presets->get_selected_preset_parent();
@@ -1625,7 +1628,7 @@ void TabPrinter::extruders_count_changed(size_t extruders_count){
}
void TabPrinter::build_extruder_pages(){
- if (m_extruders_count_old == m_extruders_count)
+ if (m_extruders_count_old == m_extruders_count || m_extruders_count <= 2)
{
// if we have a single extruder MM setup, add a page with configuration options:
for (int i = 0; i < m_pages.size(); ++i) // first make sure it's not there already
@@ -1642,8 +1645,6 @@ void TabPrinter::build_extruder_pages(){
optgroup->append_single_option_line("parking_pos_retraction");
m_pages.insert(m_pages.end()-2, page);
}
- rebuild_page_tree();
- return;
}
for (auto extruder_idx = m_extruders_count_old; extruder_idx < m_extruders_count; ++extruder_idx){