[Scummvm-git-logs] scummvm master -> 5cb84a437d865d2c38c6ed71374f86a61f691848

criezy criezy at scummvm.org
Sat Sep 26 23:32:05 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5cb84a437d SDL: Clip the coordinates sent by mouse events


Commit: 5cb84a437d865d2c38c6ed71374f86a61f691848
    https://github.com/scummvm/scummvm/commit/5cb84a437d865d2c38c6ed71374f86a61f691848
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2020-09-27T00:32:01+01:00

Commit Message:
SDL: Clip the coordinates sent by mouse events

Changed paths:
    backends/graphics/sdl/sdl-graphics.cpp


diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 1c8e8b4cf6..d5e766a690 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -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)) {




More information about the Scummvm-git-logs mailing list