@@ -180,16 +180,27 @@ namespace hal
180180 Node firstNode = node;
181181 QSet<u32 > gatIds;
182182 QSet<u32 > modIds;
183+
184+ GraphContext* context = gContentManager ->getContextManagerWidget ()->getCurrentContext ();
185+ Q_ASSERT (context);
186+
187+ // exclusive module view will update automatically if module elements get moved
188+ bool specialUpdateRequired = !context->getExclusiveModuleId ();
189+
183190 if (node.isNull ())
184191 {
185192 for (u32 id : gSelectionRelay ->selectedGatesList ())
186193 {
194+ if (specialUpdateRequired && ! context->gates ().contains (id))
195+ specialUpdateRequired = false ;
187196 if (firstNode.isNull ()) firstNode = Node (id,Node::Gate);
188197 gatIds.insert (id);
189198 }
190199
191200 for (u32 id : gSelectionRelay ->selectedModulesList ())
192201 {
202+ if (specialUpdateRequired && ! context->modules ().contains (id))
203+ specialUpdateRequired = false ;
193204 if (firstNode.isNull ()) firstNode = Node (id,Node::Module);
194205 modIds.insert (id);
195206 }
@@ -240,16 +251,17 @@ namespace hal
240251 }
241252
242253 // move module to position of first content node
243- GraphContext* context = gContentManager -> getContextManagerWidget ()->getCurrentContext ( );
244- if (context)
254+ const NodeBox* box = context-> getLayouter ()->boxes (). boxForNode (firstNode );
255+ if (box && (specialUpdateRequired || context-> getExclusiveModuleId ()) )
245256 {
246- const NodeBox* box = context->getLayouter ()->boxes ().boxForNode (firstNode);
247- if (box)
248- {
249- ActionMoveNode* actMoveNode = new ActionMoveNode (context->id (),
250- QPoint (box->x (),box->y ()));
251- compound->addAction (actMoveNode);
252- }
257+ ActionMoveNode* actMoveNode = new ActionMoveNode (context->id (), QPoint (box->x (),box->y ()));
258+ compound->addAction (actMoveNode);
259+ }
260+
261+ if (specialUpdateRequired)
262+ {
263+ context->setSpecialUpdate (true );
264+ context->setScheduleRemove (modIds,gatIds);
253265 }
254266
255267 compound->exec ();
0 commit comments