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.
This commit is contained in:
parent
d1ab94db24
commit
c278677d07
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue