Copy and paste -> Added offset to pasted objects/volumes

This commit is contained in:
Enrico Turri 2019-04-11 11:27:15 +02:00
parent 99993170eb
commit bd2ac8f1f8

View File

@ -1770,6 +1770,7 @@ void Selection::paste_volumes_from_clipboard()
ModelVolume* dst_volume = dst_object->add_volume(*src_volume); ModelVolume* dst_volume = dst_object->add_volume(*src_volume);
dst_volume->config = src_volume->config; dst_volume->config = src_volume->config;
dst_volume->set_new_unique_id(); dst_volume->set_new_unique_id();
dst_volume->translate(10.0, 10.0, 0.0);
volumes.push_back(dst_volume); volumes.push_back(dst_volume);
} }
wxGetApp().obj_list()->paste_volumes_into_list(obj_idx, volumes); wxGetApp().obj_list()->paste_volumes_into_list(obj_idx, volumes);
@ -1783,6 +1784,7 @@ void Selection::paste_objects_from_clipboard()
for (const ModelObject* src_object : src_objects) for (const ModelObject* src_object : src_objects)
{ {
ModelObject* dst_object = m_model->add_object(*src_object); ModelObject* dst_object = m_model->add_object(*src_object);
dst_object->translate(10.0, 10.0, 0.0);
object_idxs.push_back(m_model->objects.size() - 1); object_idxs.push_back(m_model->objects.size() - 1);
} }
wxGetApp().obj_list()->paste_objects_into_list(object_idxs); wxGetApp().obj_list()->paste_objects_into_list(object_idxs);