[Fix] A bug in window_create, it's been there since forever. :P

This commit is contained in:
Allanis 2013-07-22 18:51:27 +01:00
parent 1d5a88ba95
commit c4705b7142

View File

@ -476,16 +476,16 @@ unsigned int window_create(char* name, const int x, const int y,
/* x pos. */ /* x pos. */
if(x == -1) if(x == -1)
/* Center. */ /* Center. */
wdw->x = SCREEN_W/2. - windows[nwindows].w/2.; wdw->x = (SCREEN_W - windows[nwindows].w)/2.;
else if(x < 0) else if(x < 0)
wdw->x = SCREEN_W - windows[nwindows].w + (double)x; wdw->x = SCREEN_W - windows[nwindows].w + (double)x;
else windows[nwindows].x = (double)x; else windows[nwindows].x = (double)x;
/* y pos. */ /* y pos. */
if(y == -1) if(y == -1)
/* Center. */ /* Center. */
wdw->y = SCREEN_H/2. - windows[nwindows].h/2.; wdw->y = (SCREEN_H - windows[nwindows].h)/2.;
else if(y < 0) else if(y < 0)
wdw->x = SCREEN_H - windows[nwindows].h + (double)y; wdw->y = SCREEN_H - windows[nwindows].h + (double)y;
else wdw->y = (double)y; else wdw->y = (double)y;
wdw->widgets = NULL; wdw->widgets = NULL;