[hackers] [wmii] Fixed drawing of rectangle borders

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri Feb 09 19:22:56 2007

changeset: 1810:7ca6539ac4b3
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Feb 09 13:21:07 2007 -0500
summary: Fixed drawing of rectangle borders

diff -r 85838fc2122c -r 7ca6539ac4b3 draw.c
--- a/draw.c Fri Feb 09 12:50:04 2007 -0500
+++ b/draw.c Fri Feb 09 13:21:07 2007 -0500
@@ -155,7 +155,8 @@ drawbg(Display *dpy, Drawable drawable,
         if(border) {
                 XSetLineAttributes(dpy, gc, border, LineSolid, CapButt, JoinMiter);
                 XSetForeground(dpy, gc, c.border);
- XDrawRectangle(dpy, drawable, gc, rect->x, rect->y, rect->width - 1, rect->height - 1);
+ XDrawRectangle(dpy, drawable, gc, rect->x + border / 2, rect->y + border / 2,
+ rect->width - border, rect->height - border);
         }
 }
 
diff -r 85838fc2122c -r 7ca6539ac4b3 frame.c
--- a/frame.c Fri Feb 09 12:50:04 2007 -0500
+++ b/frame.c Fri Feb 09 13:21:07 2007 -0500
@@ -173,6 +173,7 @@ draw_frame(Frame *f) {
                 f->tile.border = def.border;
                 f->tile.rect = f->rect;
                 f->tile.rect.x = f->tile.rect.y = 0;
+ draw_border(&f->tile);
         }
         f->grabbox.rect = f->tile.rect;
         f->grabbox.rect.height = labelh(&def.font);
@@ -180,14 +181,15 @@ draw_frame(Frame *f) {
         f->titlebar.rect = f->grabbox.rect;
         f->titlebar.rect.x = f->grabbox.rect.x + f->grabbox.rect.width;
         f->titlebar.rect.width = f->rect.width - f->titlebar.rect.x;
+ f->titlebar.border = 0;
         draw_tile(&f->tile);
         draw_tile(&f->grabbox);
         draw_label(&f->titlebar, f->client->name);
- draw_border(&f->tile);
         /* XXX: Hack */
- f->tile.rect.height = labelh(&def.font);
- f->tile.border = 1;
- draw_border(&f->tile);
+ f->titlebar.rect.x = 0;
+ f->titlebar.rect.width += f->grabbox.rect.width;
+ f->titlebar.border = 1;
+ draw_border(&f->titlebar);
         XCopyArea(blz.dpy, pmap, f->client->framewin, f->client->gc,
                         0, 0, f->rect.width, f->rect.height, 0, 0);
         XSync(blz.dpy, False);
Received on Fri Feb 09 2007 - 19:22:56 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:06 UTC