raw_mouse changed to screen_mouse
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ namespace VISEQ::BASE {
|
|||||||
virtual bool pickedUp() {
|
virtual bool pickedUp() {
|
||||||
if(clicked() && held()) {
|
if(clicked() && held()) {
|
||||||
picked_up = true;
|
picked_up = true;
|
||||||
drag_offset = position - state->raw_mouse;
|
drag_offset = position - state->screen_mouse;
|
||||||
}
|
}
|
||||||
return picked_up;
|
return picked_up;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -136,7 +136,7 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
|
|
||||||
void draw(Vec2Df mouse, Camera2D cam) override {
|
void draw(Vec2Df mouse, Camera2D cam) override {
|
||||||
Node::draw();
|
Node::draw();
|
||||||
interact();
|
if(hovering()) interact();
|
||||||
|
|
||||||
last = time;
|
last = time;
|
||||||
time = GetTime();
|
time = GetTime();
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
virtual void trigger() {};
|
virtual void trigger() {};
|
||||||
|
|
||||||
virtual bool hovering() override {
|
virtual bool hovering() override {
|
||||||
return CheckCollisionPointCircle(state->raw_mouse, position, radius);
|
return CheckCollisionPointCircle(state->screen_mouse, position, radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
void update() override{
|
void update() override{
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ namespace VISEQ::APP{
|
|||||||
};
|
};
|
||||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(AppSettings, width, height, grid, bpm, fps, speed, gui_selected_midi_out)
|
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(AppSettings, width, height, grid, bpm, fps, speed, gui_selected_midi_out)
|
||||||
|
|
||||||
|
enum InteractionState {HOVER_CANVAS, HOVER_NODE, HOVER_CONNECTOR, ADD_NODES_MENU, DRAG_NODE, CONNECT_NODE, DRAW_SELECTION, SCALE_SELECTION, DELETE_SELECTED_NODES, COPY_SELECTED_NODES, PASTE_SELECTED_NODES};
|
||||||
|
|
||||||
class State{
|
class State{
|
||||||
public:
|
public:
|
||||||
State(){}
|
State(){}
|
||||||
@@ -28,6 +30,8 @@ namespace VISEQ::APP{
|
|||||||
Vec2Df screen_mouse;
|
Vec2Df screen_mouse;
|
||||||
Vec2Df mod_mouse;
|
Vec2Df mod_mouse;
|
||||||
|
|
||||||
|
InteractionState istate = HOVER_CANVAS;
|
||||||
|
|
||||||
int node_mode = 0;
|
int node_mode = 0;
|
||||||
|
|
||||||
inline static std::shared_ptr<State> instance;
|
inline static std::shared_ptr<State> instance;
|
||||||
|
|||||||
Reference in New Issue
Block a user