Double connections fixed
This commit is contained in:
+9
-1
@@ -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});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user