summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--draw.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/draw.c b/draw.c
index 178770b..0e02d6c 100644
--- a/draw.c
+++ b/draw.c
@@ -35,7 +35,6 @@ drawtext(const char *text, unsigned long col[ColLast], Bool filledsquare, Bool e
35 unsigned int len, olen; 35 unsigned int len, olen;
36 XGCValues gcv; 36 XGCValues gcv;
37 XRectangle r = { dc.x, dc.y, dc.w, dc.h }; 37 XRectangle r = { dc.x, dc.y, dc.w, dc.h };
38 XPoint pt[5];
39 38
40 XSetForeground(dpy, dc.gc, col[ColBG]); 39 XSetForeground(dpy, dc.gc, col[ColBG]);
41 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); 40 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
@@ -74,24 +73,15 @@ drawtext(const char *text, unsigned long col[ColLast], Bool filledsquare, Bool e
74 XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); 73 XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
75 } 74 }
76 x = (h + 2) / 4; 75 x = (h + 2) / 4;
76 r.x = dc.x + 1;
77 r.y = dc.y + 1;
77 if(filledsquare) { 78 if(filledsquare) {
78 r.x = dc.x + 1;
79 r.y = dc.y + 1;
80 r.width = r.height = x + 1; 79 r.width = r.height = x + 1;
81 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); 80 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
82 } 81 }
83 else if(emptysquare) { 82 else if(emptysquare) {
84 pt[0].x = dc.x + 1; 83 r.width = r.height = x;
85 pt[0].y = dc.y + 1; 84 XDrawRectangles(dpy, dc.drawable, dc.gc, &r, 1);
86 pt[1].x = x;
87 pt[1].y = 0;
88 pt[2].x = 0;
89 pt[2].y = x;
90 pt[3].x = -x;
91 pt[3].y = 0;
92 pt[4].x = 0;
93 pt[4].y = -x;
94 XDrawLines(dpy, dc.drawable, dc.gc, pt, 5, CoordModePrevious);
95 } 85 }
96} 86}
97 87