From 8bc64d87e99b40523de2e0da53f83c20f07516e8 Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Tue, 2 Jun 2009 03:01:17 +0000 Subject: [PATCH] Force the popup window to be completely oin scs\reen. Fixes bug #2799727. --- client/GUIClasses.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index b281fdb1e..ba0336d73 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -10,6 +10,7 @@ #include "CGameInfo.h" #include "CHeroWindow.h" #include "CMessage.h" +#include "CConfigHandler.h" #include "SDL_framerate.h" #include "CConfigHandler.h" #include "CCreatureAnimation.h" @@ -629,6 +630,12 @@ CInfoPopup::CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free) pos.y = y; pos.h = bitmap->h; pos.w = bitmap->w; + + // Put the window back on screen if necessary + amax(pos.x, 0); + amax(pos.y, 0); + amin(pos.x, conf.cc.resx - bitmap->w); + amin(pos.y, conf.cc.resy - bitmap->h); } CInfoPopup::CInfoPopup(SDL_Surface *Bitmap, bool Free)