From c278677d07e855071bb64d7005594db94ac1a103 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Mon, 27 Nov 2017 20:30:35 -0600 Subject: SDL: Store fake mouse warp event in virtual coordinates Normally, notifyMousePosition converts real mouse events into the virtual coordinate system, but events only get sent through notifyMousePosition if they are real events from SDL since that method also decides if the real mouse is inside the content area or not. As such, these fake events need to be pre-converted to virtual coordinates or else the wrong values are sent through to the engine when a scaler or AR correction is in use. --- backends/graphics/sdl/sdl-graphics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backends/graphics') diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 864fc10099..336b16a5a1 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -221,7 +221,8 @@ bool SdlGraphicsManager::notifyMousePosition(Common::Point &mouse) { void SdlGraphicsManager::setSystemMousePosition(const int x, const int y) { assert(_window); if (!_window->warpMouseInWindow(x, y)) { - _eventSource->fakeWarpMouse(x, y); + const Common::Point mouse = convertWindowToVirtual(x, y); + _eventSource->fakeWarpMouse(mouse.x, mouse.y); } } -- cgit v1.2.3