From 2c449320d0a46ee23728a0d222b761d5072fa2ba Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 2 Aug 2016 08:20:48 -0700 Subject: [PATCH] when and ID of a SpatiallyNestable subclass is changed, update the parentID of any children --- libraries/shared/src/SpatiallyNestable.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/shared/src/SpatiallyNestable.cpp b/libraries/shared/src/SpatiallyNestable.cpp index c912ecfc47..c3dbafa0d9 100644 --- a/libraries/shared/src/SpatiallyNestable.cpp +++ b/libraries/shared/src/SpatiallyNestable.cpp @@ -41,6 +41,10 @@ const QUuid SpatiallyNestable::getID() const { } void SpatiallyNestable::setID(const QUuid& id) { + // adjust the parentID of any children + forEachChild([&](SpatiallyNestablePointer object) { + object->setParentID(id); + }); _idLock.withWriteLock([&] { _id = id; });