-
-
Save Milek7/8b0eaa3c87d315f5a2baf68b9c461176 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/gfx.cpp b/src/gfx.cpp | |
index b5267e42a..19c06471b 100644 | |
--- a/src/gfx.cpp | |
+++ b/src/gfx.cpp | |
@@ -1800,8 +1800,8 @@ void CursorVars::UpdateCursorPositionRelative(int delta_x, int delta_y) | |
int last_position_x = this->pos.x; | |
int last_position_y = this->pos.y; | |
- this->pos.x = Clamp(this->pos.x + delta_x, 0, _cur_resolution.width); | |
- this->pos.y = Clamp(this->pos.y + delta_y, 0, _cur_resolution.height); | |
+ this->pos.x = Clamp(this->pos.x + delta_x, 0, _cur_resolution.width - 1); | |
+ this->pos.y = Clamp(this->pos.y + delta_y, 0, _cur_resolution.height - 1); | |
this->delta.x = last_position_x - this->pos.x; | |
this->delta.y = last_position_y - this->pos.y; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment