If the window position is saved, make sure it's not negative

(since this indicates an invalid position, and it would appear
like saving the position doesn't work).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11433 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2012-07-23 23:42:22 +00:00
parent 03c0ceedbc
commit 90402c529d

View File

@@ -116,6 +116,11 @@ void IrrDriver::updateConfigIfRelevant()
{
int x = (int)placement.rcNormalPosition.left;
int y = (int)placement.rcNormalPosition.top;
// If the windows position is saved, it must be a non-negative
// number. So if the window is partly off screen, move it to the
// corresponding edge.
if(x<0) x = 0;
if(y<0) y = 0;
printf("Retrieved window location for config : %i %i\n", x, y);
if (UserConfigParams::m_window_x != x || UserConfigParams::m_window_y != y)