diff options
Diffstat (limited to 'backends/sdl/graphics.cpp')
-rw-r--r-- | backends/sdl/graphics.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp index 138e70d279..fb93a6a322 100644 --- a/backends/sdl/graphics.cpp +++ b/backends/sdl/graphics.cpp @@ -1129,9 +1129,6 @@ void OSystem_SDL::showOverlay() { x = _mouseCurState.x * _overlayScale; y = _mouseCurState.y * _overlayScale; - if (_adjustAspectRatio) - y = real2Aspect(y); - warpMouse(x, y); clearOverlay(); @@ -1152,9 +1149,6 @@ void OSystem_SDL::hideOverlay() { x = _mouseCurState.x / _overlayScale; y = _mouseCurState.y / _overlayScale; - if (_adjustAspectRatio) - y = real2Aspect(y); - warpMouse(x, y); clearOverlay(); @@ -1296,6 +1290,9 @@ void OSystem_SDL::setMousePos(int x, int y) { } void OSystem_SDL::warpMouse(int x, int y) { + if (_adjustAspectRatio) + y = real2Aspect(y); + if (_mouseCurState.x != x || _mouseCurState.y != y) { if (_overlayVisible) SDL_WarpMouse(x * _scaleFactor / _overlayScale, y * _scaleFactor / _overlayScale); |