From c4705b71423d3e4689d5fb1e337d09f55d0112b4 Mon Sep 17 00:00:00 2001 From: Allanis <allanis@saracraft.net> Date: Mon, 22 Jul 2013 18:51:27 +0100 Subject: [PATCH] [Fix] A bug in window_create, it's been there since forever. :P --- src/toolkit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/toolkit.c b/src/toolkit.c index 6a492ce..6a600ed 100644 --- a/src/toolkit.c +++ b/src/toolkit.c @@ -476,16 +476,16 @@ unsigned int window_create(char* name, const int x, const int y, /* x pos. */ if(x == -1) /* Center. */ - wdw->x = SCREEN_W/2. - windows[nwindows].w/2.; + wdw->x = (SCREEN_W - windows[nwindows].w)/2.; else if(x < 0) wdw->x = SCREEN_W - windows[nwindows].w + (double)x; else windows[nwindows].x = (double)x; /* y pos. */ if(y == -1) /* Center. */ - wdw->y = SCREEN_H/2. - windows[nwindows].h/2.; + wdw->y = (SCREEN_H - windows[nwindows].h)/2.; 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; wdw->widgets = NULL;