Assembly: Fix case of link groups

This commit is contained in:
PaddleStroke
2024-08-08 17:16:43 +02:00
committed by Yorik van Havre
parent 5cb2fd5261
commit 7c6dde17fb
7 changed files with 183 additions and 139 deletions

View File

@@ -544,6 +544,17 @@ bool ViewProviderAssembly::canDragObjectIn3d(App::DocumentObject* obj) const
// Check if the selected object is a child of the assembly
if (!assemblyPart->hasObject(obj, true)) {
// hasObject does not detect LinkElements (see
// https://github.com/FreeCAD/FreeCAD/issues/16113) the following block can be removed if
// the issue is fixed :
auto* linkEl = dynamic_cast<App::LinkElement*>(obj);
if (linkEl) {
auto* linkGroup = linkEl->getLinkGroup();
if (assemblyPart->hasObject(linkGroup, true)) {
return true;
}
}
return false;
}