summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/debugwindow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index c41e0a5e..68b70817 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -68,8 +68,8 @@ void DebugWindow::logic()
// Get the current mouse position
int mouseX, mouseY;
SDL_GetMouseState(&mouseX, &mouseY);
- int mouseTileX = mouseX / 32 + viewport->getCameraX();
- int mouseTileY = mouseY / 32 + viewport->getCameraY();
+ int mouseTileX = (mouseX + viewport->getCameraX()) / 32;
+ int mouseTileY = (mouseY + viewport->getCameraY()) / 32;
mFPSLabel->setCaption(toString(fps) + " FPS");
mFPSLabel->adjustSize();