Assembly: Fix subassembly linkgroups not moving with dragger

This commit is contained in:
PaddleStroke
2025-09-23 16:05:40 +02:00
committed by Chris Hennes
parent e9ce06155d
commit 27806651b4

View File

@@ -766,7 +766,18 @@ void ViewProviderAssembly::collectMovableObjects(App::DocumentObject* selRoot,
for (auto* child : children) {
// Recurse on children, appending the child's name to the subName prefix
std::string newSubNamePrefix = subNamePrefix + child->getNameInDocument() + ".";
collectMovableObjects(selRoot, newSubNamePrefix, child, onlySolids);
if (child->isDerivedFrom<App::Link>() && child->isLinkGroup()) {
auto* link = static_cast<App::Link*>(child);
std::vector<App::DocumentObject*> elts = link->ElementList.getValues();
for (auto* elt : elts) {
std::string eltSubNamePrefix =
newSubNamePrefix + elt->getNameInDocument() + ".";
collectMovableObjects(selRoot, eltSubNamePrefix, elt, onlySolids);
}
}
else {
collectMovableObjects(selRoot, newSubNamePrefix, child, onlySolids);
}
}
return;
}