connecting does weird things!

This commit is contained in:
Sebastian
2024-11-12 01:42:05 +01:00
parent 31a1a264d4
commit 96082e1190
5 changed files with 62 additions and 24 deletions
+16 -4
View File
@@ -18,9 +18,13 @@ namespace VISEQ::GRAPH::NODES {
class Node : public BASE::Draggable, public GraphItem{
public:
Node() {}
Node(float x, float y) : Draggable(Vec2Df(x, y)) {}
Node(Vec2Df p) : Draggable(p) {}
Node() {addConnector();}
Node(float x, float y) : Draggable(Vec2Df(x, y)) {addConnector();}
Node(Vec2Df p) : Draggable(p) {addConnector();}
void addConnector() {
connectors.emplace_back(std::make_shared<Connector>(position, radius + 5.0f));
}
NodeType nodeType;
@@ -55,7 +59,15 @@ namespace VISEQ::GRAPH::NODES {
c->update();
}
}
void draw(Vec2Df mp, Camera2D cam) override {}
void draw() override{
for(auto c : connectors){
c->draw();
}
}
};
typedef std::shared_ptr<VISEQ::GRAPH::NODES::Node> SPTR_Node;