diff --git a/src/controls/MouseController.cpp b/src/controls/MouseController.cpp index 5045f8c..4f651ca 100644 --- a/src/controls/MouseController.cpp +++ b/src/controls/MouseController.cpp @@ -37,7 +37,7 @@ void MouseController::handle_mouse() { state.scroll_y = (double)hid_mouse_state.wheel_delta_x / 100; // Why wheel_delta_x? if (m_mouse_state.x != state.x || m_mouse_state.y != state.y) { - nanogui::cursor_pos_callback_event(state.x, state.y); + nanogui::cursor_pos_callback_event((double)state.x, (double)state.y); } if (m_mouse_state.l_pressed != state.l_pressed) { @@ -97,12 +97,12 @@ void MouseController::draw_cursor(Application *app) { } } -void MouseController::handle_mouse_move(int x, int y) { +void MouseController::handle_mouse_move(double x, double y) { m_hid_mouse_is_used = false; auto state = m_mouse_state; - state.x = x; - state.y = y; + state.x = (int)x; + state.y = (int)y; if (set_new_mouse_state(state)) { nanogui::cursor_pos_callback_event(x, y); diff --git a/src/controls/MouseController.hpp b/src/controls/MouseController.hpp index e78bdbb..57e54d3 100644 --- a/src/controls/MouseController.hpp +++ b/src/controls/MouseController.hpp @@ -45,7 +45,7 @@ private: bool m_draw_cursor_for_hid_mouse = true; double m_last_touch_y = 0; - void handle_mouse_move(int x, int y); + void handle_mouse_move(double x, double y); void handle_mouse_buttons(int button, int action, int modifiers); void handle_mouse_scroll(int x, int y); bool set_new_mouse_state(MouseState& state);