Skip to content

Commit

Permalink
#6145: Restore the original selection when leaving focus mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Nov 4, 2022
1 parent 7887e56 commit 4e1cf5c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions radiantcore/selection/RadiantSelectionSystem.cpp
Expand Up @@ -79,14 +79,24 @@ void RadiantSelectionSystem::toggleSelectionFocus()
{
rMessage() << "Leaving selection focus mode" << std::endl;
_selectionFocusActive = false;
_selectionFocusPool.clear();


GlobalSceneGraph().root()->foreachNode([&](const scene::INodePtr& node)
{
node->setRenderState(scene::INode::RenderState::Active);
return true;
});

// Re-select the pieces we had selected before entering
for (const auto& node : _selectionFocusPool)
{
// Nodes might have been removed in the meantime
if (node->inScene())
{
Node_setSelected(node, true);
}
}

_selectionFocusPool.clear();
SceneChangeNotify();
return;
}
Expand Down

0 comments on commit 4e1cf5c

Please sign in to comment.