Browse Source

Force the popup window to be completely oin scs\reen. Fixes bug #2799727.

Frank Zago 16 years ago
parent
commit
8bc64d87e9
1 changed files with 7 additions and 0 deletions
  1. 7 0
      client/GUIClasses.cpp

+ 7 - 0
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)