Skip to content

Commit

Permalink
Resolve #5054: Hiding objects did not clear the component selection o…
Browse files Browse the repository at this point in the history
…f those nodes
  • Loading branch information
codereader committed Nov 26, 2019
1 parent 653a9f7 commit 439edd3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions radiant/selection/algorithm/General.cpp
Expand Up @@ -218,12 +218,28 @@ inline void hideNode(const scene::INodePtr& node, bool hide)
}
}

// If the given node has any components of any kind, set the component selection status to the given flag
inline void setComponentSelection(const scene::INodePtr& node, bool selected)
{
ComponentSelectionTestablePtr componentSelectionTestable = Node_getComponentSelectionTestable(node);

if (componentSelectionTestable)
{
componentSelectionTestable->setSelectedComponents(selected, SelectionSystem::eVertex);
componentSelectionTestable->setSelectedComponents(selected, SelectionSystem::eEdge);
componentSelectionTestable->setSelectedComponents(selected, SelectionSystem::eFace);
}
}

void hideSelected(const cmd::ArgumentList& args)
{
// Traverse the selection, hiding all nodes
GlobalSelectionSystem().foreachSelected([] (const scene::INodePtr& node)
{
hideSubgraph(node, true);

// De-select all components of the node that is going to be hidden (#5054)
setComponentSelection(node, false);
});

// Then de-select the hidden nodes
Expand Down

0 comments on commit 439edd3

Please sign in to comment.