node deletion with connection deletion and signal redistribution implemented
This commit is contained in:
+9
-3
@@ -19,11 +19,13 @@ class Node : public Movable{
|
||||
|
||||
public:
|
||||
Node() {}
|
||||
Node(float x, float y, float r) : Movable(Vec2D<float>(x, y), 0.0f), radius(r) {}
|
||||
Node(Vec2D<float> p, float r) : Movable(p, 0.0f), radius(r) {}
|
||||
Node(int id, float x, float y, float r) : Movable(Vec2D<float>(x, y), 0.0f), radius(r), id(id) {}
|
||||
Node(int id, Vec2D<float> p, float r) : Movable(p, 0.0f), radius(r), id(id) {}
|
||||
|
||||
float radius;
|
||||
|
||||
int id;
|
||||
|
||||
bool picked_up = false;
|
||||
bool dragging = false;
|
||||
bool in_rect = false;
|
||||
@@ -33,6 +35,7 @@ class Node : public Movable{
|
||||
bool config = false;
|
||||
bool selected = false;
|
||||
bool erase = false;
|
||||
bool highlighted = false;
|
||||
|
||||
int midi_out = -1;
|
||||
|
||||
@@ -60,7 +63,9 @@ class Node : public Movable{
|
||||
|
||||
void draw(Vec2D<float> *mouse, Camera2D *cam) {
|
||||
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});
|
||||
if(selected || dragging || in_rect || hovering) DrawCircle(position.x, position.y, radius, (Color){108, 153, 187, 255});
|
||||
if(selected) DrawCircleLinesV(position, radius+1, (Color){158, 255, 210, 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 );
|
||||
|
||||
@@ -76,5 +81,6 @@ class Node : public Movable{
|
||||
DrawCircleLines(position.x, position.y, radius + R, (Color){108, 153, 187, (unsigned char)opacity});
|
||||
DrawCircle(connector.x, connector.y, 8.0f, (Color){108, 153, 187, (unsigned char)opacity});
|
||||
}
|
||||
if(highlighted) DrawCircleLinesV(position, radius+2, (Color){255, 0, 0, 200});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user