Selection working partially. Needs global z-index hovering to work reliably.

This commit is contained in:
Sebastian
2024-11-16 00:29:01 +01:00
parent 96526f709a
commit 55926a5021
9 changed files with 64 additions and 20 deletions
+4 -4
View File
@@ -25,7 +25,7 @@ namespace VISEQ::GRAPH::NODES {
Node(Vec2Df p) : Draggable(p) {}
void addConnector() {
connectors.emplace_back(std::make_shared<Connector>(std::make_shared<GraphItem>(this), position, radius + 5.0f));
connectors.emplace_back(std::make_shared<Connector>(GraphItem::getptr(), position, radius + 5.0f));
connectors.back()->init();
}
@@ -56,12 +56,12 @@ namespace VISEQ::GRAPH::NODES {
virtual void trigger() {};
virtual bool hovering() override {
return CheckCollisionPointCircle(state->screen_mouse, position, radius);
return CheckCollisionPointCircle(state->screen_mouse, position, radius);
}
void update() override{
if(pickedUp()) drag();
if(hovering()) state->hovering = true;
if(pickedUp() || selected) drag();
if(released()) putDown();
int free_connectors = 0;
for(auto c : connectors){