Fixed update of PrintRegions after removing an object.
The bug has been introduced during recent PrintRegion refactoring.
This commit is contained in:
parent
e0dd7edb21
commit
221af991c2
1 changed files with 3 additions and 1 deletions
|
@ -372,6 +372,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
|
||||||
std::set<ModelObjectStatus> model_object_status;
|
std::set<ModelObjectStatus> model_object_status;
|
||||||
|
|
||||||
// 1) Synchronize model objects.
|
// 1) Synchronize model objects.
|
||||||
|
bool print_regions_reshuffled = false;
|
||||||
if (model.id() != m_model.id()) {
|
if (model.id() != m_model.id()) {
|
||||||
// Kill everything, initialize from scratch.
|
// Kill everything, initialize from scratch.
|
||||||
// Stop background processing.
|
// Stop background processing.
|
||||||
|
@ -383,6 +384,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
|
||||||
delete object;
|
delete object;
|
||||||
}
|
}
|
||||||
m_objects.clear();
|
m_objects.clear();
|
||||||
|
print_regions_reshuffled = true;
|
||||||
m_model.assign_copy(model);
|
m_model.assign_copy(model);
|
||||||
for (const ModelObject *model_object : m_model.objects)
|
for (const ModelObject *model_object : m_model.objects)
|
||||||
model_object_status.emplace(model_object->id(), ModelObjectStatus::New);
|
model_object_status.emplace(model_object->id(), ModelObjectStatus::New);
|
||||||
|
@ -462,6 +464,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
|
||||||
}
|
}
|
||||||
for (ModelObject *model_object : model_objects_old)
|
for (ModelObject *model_object : model_objects_old)
|
||||||
delete model_object;
|
delete model_object;
|
||||||
|
print_regions_reshuffled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -595,7 +598,6 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4) Generate PrintObjects from ModelObjects and their instances.
|
// 4) Generate PrintObjects from ModelObjects and their instances.
|
||||||
bool print_regions_reshuffled = false;
|
|
||||||
{
|
{
|
||||||
PrintObjectPtrs print_objects_new;
|
PrintObjectPtrs print_objects_new;
|
||||||
print_objects_new.reserve(std::max(m_objects.size(), m_model.objects.size()));
|
print_objects_new.reserve(std::max(m_objects.size(), m_model.objects.size()));
|
||||||
|
|
Loading…
Reference in a new issue