Skip to content

Commit

Permalink
SDL: Store fake mouse warp event in virtual coordinates
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
csnover committed Nov 28, 2017
1 parent d1ab94d commit c278677
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backends/graphics/sdl/sdl-graphics.cpp
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit c278677

Please sign in to comment.