aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/openglsdl
diff options
context:
space:
mode:
Diffstat (limited to 'backends/graphics/openglsdl')
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index b10c94b03f..c7ce0aa7de 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -195,6 +195,18 @@ void OpenGLSdlGraphicsManager::warpMouse(int x, int y) {
int scaledX = x;
int scaledY = y;
+ int16 currentX = _cursorState.x;
+ int16 currentY = _cursorState.y;
+
+ adjustMousePosition(currentX, currentY);
+
+ // Do not adjust the real screen position, when the current game / overlay
+ // coordinates match the requested coordinates. This avoids a slight
+ // movement which might occur otherwise when the mouse is at a subpixel
+ // position.
+ if (x == currentX && y == currentY)
+ return;
+
if (_videoMode.mode == OpenGL::GFX_NORMAL) {
if (_videoMode.hardwareWidth != _videoMode.overlayWidth)
scaledX = scaledX * _videoMode.hardwareWidth / _videoMode.overlayWidth;