summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-20 18:24:03 -0700
committerIra Rice <irarice@gmail.com>2009-01-20 18:24:03 -0700
commitb0ff8cc281d7e7f8f3c2666d6bbe6424fec74f9c (patch)
tree65123f2d756f8838a7812ae9935e2095e5080f2d
parentc6d75d9aad1775e60cc63516e844cf54623a3974 (diff)
downloadmana-client-b0ff8cc281d7e7f8f3c2666d6bbe6424fec74f9c.tar.gz
mana-client-b0ff8cc281d7e7f8f3c2666d6bbe6424fec74f9c.tar.bz2
mana-client-b0ff8cc281d7e7f8f3c2666d6bbe6424fec74f9c.tar.xz
mana-client-b0ff8cc281d7e7f8f3c2666d6bbe6424fec74f9c.zip
Fixed y positioning so that popups don't run off of the screen (old
behavior overprotected the bottom of the window, but didn't protect the top at all. Forgot to fix for that earlier) Signed-off-by: Ira Rice <irarice@gmail.com>
-rw-r--r--src/gui/itempopup.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp
index 81e4607b..f9916a89 100644
--- a/src/gui/itempopup.cpp
+++ b/src/gui/itempopup.cpp
@@ -122,8 +122,8 @@ void ItemPopup::view(int x, int y)
{
if (windowContainer->getWidth() < (x + getWidth() + 5))
x = windowContainer->getWidth() - getWidth();
- if (windowContainer->getHeight() < (y + getHeight() + 5))
- y = windowContainer->getHeight() - getHeight();
+ if ((y - getHeight() - 5) < 0)
+ y = 0;
else
y = y - getHeight() - 5;
setPosition(x, y);