Double connections fixed

This commit is contained in:
Sebastian
2024-11-30 12:47:33 +01:00
parent c7e76ae7ac
commit c63ee3eabe
5 changed files with 34 additions and 18 deletions
+9 -1
View File
@@ -15,13 +15,16 @@ namespace VISEQ::BASE {
std::shared_ptr<Connectable> partner;
bool new_partner = false;
bool connecting = false;
Vec2Df connecting_position;
virtual void init() {
connectables.emplace_back(this);
}
virtual void drag(Vec2Df new_position) override {
DrawLineV(position, new_position, (Color){229, 181, 103, 255});
connecting = true;
connecting_position = new_position;
}
void putDown() override {
@@ -40,8 +43,13 @@ namespace VISEQ::BASE {
break;
}
}
connecting = false;
}
}
virtual void draw(){
if(connecting) DrawLineV(position, connecting_position, (Color){229, 181, 103, 255});
}
};
}