two direction connections with blockers working
This commit is contained in:
+11
-11
@@ -22,19 +22,19 @@ class Node : public Movable{
|
||||
bool hover_connect = false;
|
||||
bool connecting = false;
|
||||
|
||||
int next = 0;
|
||||
// int next = 0;
|
||||
|
||||
int midi_out = 0;
|
||||
|
||||
int midi_note = 0;
|
||||
int midi_cc = 0;
|
||||
|
||||
std::vector<Node*> connections;
|
||||
// std::vector<Node*> connections;
|
||||
|
||||
Node* get_next(){
|
||||
next = (next+1) % connections.size();
|
||||
return connections[next];
|
||||
}
|
||||
/*Node* get_next(){*/
|
||||
/* next = (next+1) % connections.size();*/
|
||||
/* return connections[next];*/
|
||||
/*}*/
|
||||
|
||||
void draw(Vec2D<float> *mouse) {
|
||||
if(!hover_move) DrawCircle(position.x, position.y, radius, (Color){180, 210, 115, 255});
|
||||
@@ -42,11 +42,11 @@ class Node : public Movable{
|
||||
|
||||
Vec2D<float> connector = position - ((position - *mouse)).norm() * (radius + R);
|
||||
|
||||
for(auto& to : connections){
|
||||
Vec2D<float> from_position = position - ((position - to->position)).norm() * (radius + 10.0f);
|
||||
Vec2D<float> to_position = to->position - ((to->position - position)).norm() * (to->radius + 10.0f);
|
||||
DrawLine(from_position.x, from_position.y, to_position.x, to_position.y, (Color){229, 181, 103, 255});
|
||||
}
|
||||
/*for(auto& to : connections){*/
|
||||
/* Vec2D<float> from_position = position - ((position - to->position)).norm() * (radius + 10.0f);*/
|
||||
/* Vec2D<float> to_position = to->position - ((to->position - position)).norm() * (to->radius + 10.0f);*/
|
||||
/* DrawLine(from_position.x, from_position.y, to_position.x, to_position.y, (Color){229, 181, 103, 255});*/
|
||||
/*}*/
|
||||
|
||||
if(hover_connect){
|
||||
DrawCircleLines(position.x, position.y, radius + R, (Color){108, 153, 187, 255});
|
||||
|
||||
Reference in New Issue
Block a user