summaryrefslogtreecommitdiff
path: root/src/gui/debugwindow.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-02-20 22:49:45 -0700
committerJared Adams <jaxad0127@gmail.com>2009-02-20 22:49:45 -0700
commitdf37ad4697e674d16859e69c0ce358283f410e20 (patch)
treeaaa7e5ec55802d1b6bc2c1b79ead86ea43f87abb /src/gui/debugwindow.cpp
parent952a06663d6e229ddd719f604bbf79e632d32945 (diff)
downloadmana-df37ad4697e674d16859e69c0ce358283f410e20.tar.gz
mana-df37ad4697e674d16859e69c0ce358283f410e20.tar.bz2
mana-df37ad4697e674d16859e69c0ce358283f410e20.tar.xz
mana-df37ad4697e674d16859e69c0ce358283f410e20.zip
Fix debug window to show correct mouse coordinates
Diffstat (limited to 'src/gui/debugwindow.cpp')
-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 2ed891db..42f2f110 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -67,8 +67,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();