[dev] [libsl] [PATCH 3/4] drw: fixup drw_rect function

From: Markus Teich <markus.teich_AT_stusta.mhn.de>
Date: Tue, 21 Apr 2015 23:37:49 +0200

---
 drw.c | 16 +++++++---------
 drw.h |  2 +-
 2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/drw.c b/drw.c
index 362484a..078b6b8 100644
--- a/drw.c
+++ b/drw.c
_AT_@ -204,17 +204,15 @@ drw_setscheme(Drw *drw, Scm *scm) {
 }
 
 void
-drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int empty, int invert) {
-	int dx;
-
-	if(!drw || !drw->fontcount || !drw->scheme)
+drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert)
+{
+	if (!drw || !drw->scheme)
 		return;
 	XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme->bg.pix : drw->scheme->fg.pix);
-	dx = (drw->fonts[0]->ascent + drw->fonts[0]->descent + 2) / 4;
-	if(filled)
-		XFillRectangle(drw->dpy, drw->drawable, drw->gc, x+1, y+1, dx+1, dx+1);
-	else if(empty)
-		XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x+1, y+1, dx, dx);
+	if (filled)
+		XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
+	else
+		XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
 }
 
 int
diff --git a/drw.h b/drw.h
index ccd84d9..7bcebbd 100644
--- a/drw.h
+++ b/drw.h
_AT_@ -57,7 +57,7 @@ void drw_setfont(Drw *drw, Fnt *font);
 void drw_setscheme(Drw *drw, Scm *scm);
 
 /* Drawing functions */
-void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int empty, int invert);
+void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert);
 int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *text, int invert);
 
 /* Map functions */
-- 
2.0.5
Received on Tue Apr 21 2015 - 23:37:49 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 21 2015 - 23:48:20 CEST