add node breaks connections for whatever reason...

This commit is contained in:
Sebastian
2024-10-23 03:25:57 +02:00
parent 15ee01cb56
commit 2a6bd408d4
4 changed files with 102 additions and 68 deletions
+5 -3
View File
@@ -24,8 +24,10 @@ class Node : public Movable{
float radius;
bool picked_up = false;
bool hover_move = false;
bool dragging = false;
bool in_rect = false;
bool hover_connect = false;
bool hovering = false;
bool connecting = false;
bool config = false;
bool selected = false;
@@ -51,8 +53,8 @@ class Node : public Movable{
Distribution mode = Distribution::ROUNDROBIN;
void draw(Vec2D<float> *mouse, Camera2D *cam) {
if(!hover_move) DrawCircle(position.x, position.y, radius, (Color){180, 210, 115, 255});
if(hover_move || selected) DrawCircle(position.x, position.y, radius, (Color){108, 153, 187, 255});
if(!dragging && !selected && !in_rect && !hovering) DrawCircle(position.x, position.y, radius, (Color){180, 210, 115, 255});
if(dragging || selected || in_rect || hovering) DrawCircle(position.x, position.y, radius, (Color){108, 153, 187, 255});
int offset = MeasureText(MIDI::Notes[midi_note].c_str(), 10);
DrawText(MIDI::Notes[midi_note].c_str(), position.x-offset/2.0f, position.y-5, 10, WHITE );