diff --git a/src/DrawComponents/DrawComponent.cpp b/src/DrawComponents/DrawComponent.cpp index ea85319..eb12b47 100644 --- a/src/DrawComponents/DrawComponent.cpp +++ b/src/DrawComponents/DrawComponent.cpp @@ -170,7 +170,7 @@ void DrawComponent::client_send_erase_set(DrawingProgram& drawP, const std::unor } void DrawComponent::finalize_update(DrawingProgram& drawP, bool invalidateCache) { - if(invalidateCache) + if(invalidateCache && collabListInfo.lock()) drawP.compCache.preupdate_component(collabListInfo.lock()); create_collider(drawP.colliderAllocated); } diff --git a/src/DrawingProgram/DrawingProgramSelection.cpp b/src/DrawingProgram/DrawingProgramSelection.cpp index b50104f..a2fb5a1 100644 --- a/src/DrawingProgram/DrawingProgramSelection.cpp +++ b/src/DrawingProgram/DrawingProgramSelection.cpp @@ -327,14 +327,16 @@ void DrawingProgramSelection::paste_clipboard() { std::unordered_map resourceRemapIDs; for(auto& r : clipboard.resources) resourceRemapIDs[r.first] = drawP.world.rMan.add_resource(r.second); - for(auto& c : clipboard.components) { - auto& newC = placedComponents.emplace_back(c->copy()); - newC->remap_resource_ids(resourceRemapIDs); - newC->coords.translate(-moveVec); - newC->final_update(drawP, false); - } + for(auto& c : clipboard.components) + placedComponents.emplace_back(c->copy()); drawP.addToCompCacheOnInsert = false; auto compListInserted = drawP.components.client_insert_ordered_vector_items(allPlacement, placedComponents); + parallel_loop_container(compListInserted, [&](auto& c) { + c->obj->remap_resource_ids(resourceRemapIDs); + c->obj->coords.translate(-moveVec); + c->obj->final_update(drawP, false); + }); + DrawComponent::client_send_place_many(drawP, compListInserted); drawP.addToCompCacheOnInsert = true; std::unordered_set compSetInserted(compListInserted.begin(), compListInserted.end()); set_to_selection(compSetInserted); diff --git a/src/DrawingProgram/EraserTool.cpp b/src/DrawingProgram/EraserTool.cpp index 55d49bc..c43c95b 100644 --- a/src/DrawingProgram/EraserTool.cpp +++ b/src/DrawingProgram/EraserTool.cpp @@ -1,11 +1,7 @@ #include "EraserTool.hpp" #include "DrawingProgram.hpp" -#include "../Server/CommandList.hpp" #include "../MainProgram.hpp" #include "../DrawData.hpp" -#include "../SharedTypes.hpp" -#include -#include "../DrawCollision.hpp" EraserTool::EraserTool(DrawingProgram& initDrawP): drawP(initDrawP)