소스 검색

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

Frank Zago 16 년 전
부모
커밋
8bc64d87e9
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  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)