Fix updating of gizmos when instances are added

Gizmos were in fact updated after an instance was added, but before it was selected
This commit is contained in:
Lukas Matena 2020-04-29 13:35:35 +02:00
parent 5b15e778ef
commit 04cfd5f832
2 changed files with 3 additions and 3 deletions

View file

@ -2771,6 +2771,7 @@ void ObjectList::delete_all_objects_from_list()
void ObjectList::increase_object_instances(const size_t obj_idx, const size_t num) void ObjectList::increase_object_instances(const size_t obj_idx, const size_t num)
{ {
select_item(m_objects_model->AddInstanceChild(m_objects_model->GetItemById(obj_idx), num)); select_item(m_objects_model->AddInstanceChild(m_objects_model->GetItemById(obj_idx), num));
selection_changed();
} }
void ObjectList::decrease_object_instances(const size_t obj_idx, const size_t num) void ObjectList::decrease_object_instances(const size_t obj_idx, const size_t num)

View file

@ -4377,8 +4377,6 @@ void Plater::increase_instances(size_t num)
// p->print.get_object(obj_idx)->add_copy(Slic3r::to_2d(offset_vec)); // p->print.get_object(obj_idx)->add_copy(Slic3r::to_2d(offset_vec));
} }
sidebar().obj_list()->increase_object_instances(obj_idx, was_one_instance ? num + 1 : num);
if (p->get_config("autocenter") == "1") if (p->get_config("autocenter") == "1")
arrange(); arrange();
@ -4386,8 +4384,9 @@ void Plater::increase_instances(size_t num)
p->get_selection().add_instance(obj_idx, (int)model_object->instances.size() - 1); p->get_selection().add_instance(obj_idx, (int)model_object->instances.size() - 1);
p->selection_changed(); sidebar().obj_list()->increase_object_instances(obj_idx, was_one_instance ? num + 1 : num);
p->selection_changed();
this->p->schedule_background_process(); this->p->schedule_background_process();
} }