From 8cb99e490c2cc54548e439a74c27392a09bdce90 Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Wed, 27 Feb 2013 15:43:37 +0000
Subject: [PATCH] [Fix] Bug iwth addtext and negative positions.

---
 src/toolkit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/toolkit.c b/src/toolkit.c
index 3281165..cefaec1 100644
--- a/src/toolkit.c
+++ b/src/toolkit.c
@@ -121,9 +121,9 @@ void window_addText(const unsigned int wid, const int x, const int y,
   wgt->h      = (double) h;
   if(font == NULL) wgt->dat.txt.font = &gl_defFont;
   else wgt->dat.txt.font = font;
-  if(x < 0) wgt->x = wdw->w - wgt->w + x;
+  if(x < 0) wgt->x = wdw->w - wgt->w + x - w;
   else wgt->x = (double)x;
-  if(y < 0) wgt->y = wdw->h + y;
+  if(y < 0) wgt->y = wdw->h + y - h;
   else wgt->y = (double) y;
   wgt->dat.txt.colour = colour;
   wgt->dat.txt.centered = centered;