From b0ff8cc281d7e7f8f3c2666d6bbe6424fec74f9c Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Tue, 20 Jan 2009 18:24:03 -0700 Subject: 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 --- src/gui/itempopup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui') 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); -- cgit v1.2.3-70-g09d2