From 890e00a3d96d66d798d7d7be6c508ad80e832334 Mon Sep 17 00:00:00 2001 From: theadib Date: Sat, 6 Feb 2021 20:50:13 +0100 Subject: [PATCH] resolve: in case the file has a parent the file content is not displayed --- src/JsonRPCPlugin.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/JsonRPCPlugin.cpp b/src/JsonRPCPlugin.cpp index 03779d3..0e713d5 100644 --- a/src/JsonRPCPlugin.cpp +++ b/src/JsonRPCPlugin.cpp @@ -152,6 +152,7 @@ JsonRPCResult JsonRPCPlugin::execute(QString method, QMap par newGroup->setName(objname); } + QString parentname = params["parent"].toString().trimmed(); if(!parentname.isEmpty()) { @@ -159,10 +160,22 @@ JsonRPCResult JsonRPCPlugin::execute(QString method, QMap par if(parent) { parent->addChild(newGroup); + // in addChild the display assignment to child is only to the first child, not recursivly + const auto display = m_app->getActiveGLWindow(); + if(display) { + newGroup->setDisplay_recursive(display); + } } } m_app->addToDB(newGroup); + + // after adding Zoom complete Scene into current display + auto display = m_app->getActiveGLWindow(); + if(display) { + display->zoomGlobal(); + } + need_redraw = true; result = JsonRPCResult::success(0); }