OPENGL: Fix truncation issue resulting in wrong mouse coordinates.

This commit is contained in:
Johannes Schickel 2015-01-07 20:37:08 +01:00
parent f879f8af04
commit 1124d1db31

View file

@ -928,8 +928,8 @@ void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) {
const int16 width = _gameScreen->getWidth();
const int16 height = _gameScreen->getHeight();
x = (x * width) / _displayWidth;
y = (y * height) / _displayHeight;
x = (x * width) / (int)_displayWidth;
y = (y * height) / (int)_displayHeight;
// Make sure we only supply valid coordinates.
x = CLIP<int16>(x, 0, width - 1);