mirror of
https://github.com/open-goal/jak-project
synced 2026-05-30 08:56:59 -04:00
Fixed bug where mouse position offset(s) would always return a 0 (#2109)
Co-authored-by: animalstyletaco <animalstyletaco95@gmail.com>
This commit is contained in:
@@ -357,6 +357,9 @@ void GLDisplay::on_mouse_key(GLFWwindow* /*window*/, int button, int action, int
|
||||
}
|
||||
|
||||
void GLDisplay::on_cursor_position(GLFWwindow* /*window*/, double xposition, double yposition) {
|
||||
double xoffset = xposition - last_cursor_x_position;
|
||||
double yoffset = yposition - last_cursor_y_position;
|
||||
|
||||
last_cursor_x_position = xposition;
|
||||
last_cursor_y_position = yposition;
|
||||
Pad::MappingInfo mapping_info = Gfx::get_button_mapping();
|
||||
@@ -374,9 +377,6 @@ void GLDisplay::on_cursor_position(GLFWwindow* /*window*/, double xposition, dou
|
||||
return;
|
||||
}
|
||||
|
||||
double xoffset = xposition - last_cursor_x_position;
|
||||
double yoffset = yposition - last_cursor_y_position;
|
||||
|
||||
Pad::SetAnalogAxisValue(mapping_info, GlfwKeyCustomAxis::CURSOR_X_AXIS, xoffset);
|
||||
Pad::SetAnalogAxisValue(mapping_info, GlfwKeyCustomAxis::CURSOR_Y_AXIS, yoffset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user