Xinqi Bao's Git
projects
/
dmenu.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
portability
[dmenu.git]
/
draw.c
diff --git
a/draw.c
b/draw.c
index
95ff072
..
351a43d
100644
(file)
--- a/
draw.c
+++ b/
draw.c
@@
-15,12
+15,13
@@
static Bool loadfont(DC *dc, const char *fontstr);
void
drawrect(DC *dc, int x, int y, unsigned int w, unsigned int h, Bool fill, unsigned long color) {
void
drawrect(DC *dc, int x, int y, unsigned int w, unsigned int h, Bool fill, unsigned long color) {
- XRectangle r = { dc->x + x, dc->y + y, w, h };
+ XRectangle r;
+
+ r.x = dc->x + x;
+ r.y = dc->y + y;
+ r.width = fill ? w : w-1;
+ r.height = fill ? h : h-1;
- if(!fill) {
- r.width -= 1;
- r.height -= 1;
- }
XSetForeground(dc->dpy, dc->gc, color);
(fill ? XFillRectangles : XDrawRectangles)(dc->dpy, dc->canvas, dc->gc, &r, 1);
}
XSetForeground(dc->dpy, dc->gc, color);
(fill ? XFillRectangles : XDrawRectangles)(dc->dpy, dc->canvas, dc->gc, &r, 1);
}