Assembly: Fix "deactivated by activating a App::Part, assembly stay in edit"

Fix "Activating a body in a part in an assembly deactivates the assembly and activate the part"
Fix "A manually deactivated assembly is still restoring later"
This commit is contained in:
paddle
2026-01-22 14:21:28 +01:00
committed by PaddleStroke
parent abc5f90466
commit 62cbaf7336
8 changed files with 58 additions and 15 deletions

View File

@@ -284,7 +284,11 @@ App::Part* getActivePart()
{
Gui::MDIView* activeView = Gui::Application::Instance->activeView();
if (activeView) {
return activeView->getActiveObject<App::Part*>(PARTKEY);
auto* obj = activeView->getActiveObject<App::Part*>(PARTKEY);
if (!obj) {
obj = activeView->getActiveObject<App::Part*>(ASSEMBLYKEY);
}
return obj;
}
else {
return nullptr;