global mouse moved to state and removed some GetMousePosition()s.
This commit is contained in:
+4
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user