id is not set correctly, fix needed
This commit is contained in:
@@ -142,6 +142,12 @@ namespace VISEQ::GRAPH {
|
||||
return possible_connections.at(return_path)->getNextNode(current);
|
||||
}
|
||||
|
||||
SPTR_Node getClosestNode(Vec2Df position){
|
||||
auto neighbors = nodes | RANGE_FILTER([](SPTR_Node n){ return !n->dragging;}) | std::ranges::to<VEC_SPTR_Node>();
|
||||
std::sort(neighbors.begin(), neighbors.end(), [position](SPTR_Node na, SPTR_Node nb){ return na->position.dist(position) < nb->position.dist(position);});
|
||||
return neighbors.front();
|
||||
}
|
||||
|
||||
void addConnection(SPTR_Node from, SPTR_Node to){
|
||||
if(from != to) {
|
||||
edges.emplace_back(std::make_shared<Edge>());
|
||||
|
||||
Reference in New Issue
Block a user