Skip to content

Commit

Permalink
OPENGL: Fix truncation issue resulting in wrong mouse coordinates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Jan 7, 2015
1 parent f879f8a commit 1124d1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backends/graphics/opengl/opengl-graphics.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 1124d1d

Please sign in to comment.