Dragging and selecting works. Copy / Paste does not copy connectors yet.

This commit is contained in:
Sebastian
2024-11-28 01:08:04 +01:00
parent 813958002b
commit 492971ed4f
9 changed files with 70 additions and 42 deletions
+11
View File
@@ -25,6 +25,16 @@ namespace VISEQ::GRAPH::NODES {
Node() {}
Node(float x, float y) : Draggable(Vec2Df(x, y)) {}
Node(Vec2Df p) : Draggable(p) {}
/*Node(const Node& n){*/
/* distributionMode = n.distributionMode;*/
/* radius = n.radius;*/
/* config = n.config;*/
/* position = n.position;*/
/* for(auto c : n.connectors){*/
/* connectors.emplace_back(std::make_shared<Connector>(*c));*/
/* }*/
/*}*/
NodeType nodeType;
@@ -68,6 +78,7 @@ namespace VISEQ::GRAPH::NODES {
}
void update() override{
if(hovering()) state->pushEvent({getPtr(), APP::Interaction::HOVER});
if(hovering() && clicked()) state->pushEvent({getPtr(), APP::Interaction::PICKUP});
if(pickedUp()) state->pushEvent({getPtr(), APP::Interaction::DRAG});
if(picked_up && released()) state->pushEvent({getPtr(), APP::Interaction::PUTDOWN});