SDL: Clip the coordinates sent by mouse events

This commit is contained in:
Cameron Cawley 2020-09-21 23:29:22 +01:00 committed by Thierry Crozat
parent e99a2fa8c3
commit 5cb84a437d

View File

@ -192,6 +192,9 @@ bool SdlGraphicsManager::showMouse(bool visible) {
}
bool SdlGraphicsManager::notifyMousePosition(Common::Point &mouse) {
mouse.x = CLIP<int16>(mouse.x, 0, _windowWidth - 1);
mouse.y = CLIP<int16>(mouse.y, 0, _windowHeight - 1);
int showCursor = SDL_DISABLE;
bool valid = true;
if (_activeArea.drawRect.contains(mouse)) {