global mouse moved to state and removed some GetMousePosition()s.

This commit is contained in:
Sebastian
2024-11-14 01:37:16 +01:00
parent 5d3b72d4ef
commit 2e103dc561
10 changed files with 58 additions and 60 deletions
+4 -2
View File
@@ -18,6 +18,8 @@ namespace VISEQ::GRAPH::NODES {
class Node : public BASE::Draggable, public GraphItem{
public:
using GraphItem::state;
Node() {}
Node(float x, float y) : Draggable(Vec2Df(x, y)) {}
Node(Vec2Df p) : Draggable(p) {}
@@ -52,11 +54,11 @@ namespace VISEQ::GRAPH::NODES {
virtual void trigger() {};
virtual bool hovering() override {
Vec2Df mp = {GetMousePosition().x, GetMousePosition().y};
return CheckCollisionPointCircle(mp, position, radius);
return CheckCollisionPointCircle(state->raw_mouse, position, radius);
}
void update() override{
if(pickedUp()) drag();
if(released()) putDown();
int free_connectors = 0;