Fixed UserInterface selection of multiple sources. Cleared code for

Source searching by nodes pointers.
This commit is contained in:
brunoherbelin
2020-06-17 00:03:21 +02:00
parent 89fed033e9
commit da7ce52e2c
8 changed files with 54 additions and 38 deletions

View File

@@ -120,16 +120,19 @@ void View::select(glm::vec2 A, glm::vec2 B)
// picking visitor found nodes in the area?
if ( !pv.picked().empty()) {
// create a list of source matching the list of picked nodes
SourceList selection;
for(auto p = pv.picked().begin(); p != pv.picked().end(); p++){
std::vector< std::pair<Node *, glm::vec2> > pick = pv.picked();
// loop over the nodes and add all sources found.
for(std::vector< std::pair<Node *, glm::vec2> >::iterator p = pick.begin(); p != pick.end(); p++){
Source *s = Mixer::manager().findSource( p->first );
if (s)
selection.push_back( s );
}
// set the selection with list of picked (overlaped) sources
Mixer::selection().add(selection);
Mixer::selection().set(selection);
}
}