applied apm's patch proposal, getting rid of XDrawLines
19fd903d
1 file(s) · +4 −14
| 35 | 35 | unsigned int len, olen; |
|
| 36 | 36 | XGCValues gcv; |
|
| 37 | 37 | XRectangle r = { dc.x, dc.y, dc.w, dc.h }; |
|
| 38 | - | XPoint pt[5]; |
|
| 39 | 38 | ||
| 40 | 39 | XSetForeground(dpy, dc.gc, col[ColBG]); |
|
| 41 | 40 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); |
|
| 74 | 73 | XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); |
|
| 75 | 74 | } |
|
| 76 | 75 | x = (h + 2) / 4; |
|
| 76 | + | r.x = dc.x + 1; |
|
| 77 | + | r.y = dc.y + 1; |
|
| 77 | 78 | if(filledsquare) { |
|
| 78 | - | r.x = dc.x + 1; |
|
| 79 | - | r.y = dc.y + 1; |
|
| 80 | 79 | r.width = r.height = x + 1; |
|
| 81 | 80 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); |
|
| 82 | 81 | } |
|
| 83 | 82 | else if(emptysquare) { |
|
| 84 | - | pt[0].x = dc.x + 1; |
|
| 85 | - | pt[0].y = dc.y + 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); |
|
| 83 | + | r.width = r.height = x; |
|
| 84 | + | XDrawRectangles(dpy, dc.drawable, dc.gc, &r, 1); |
|
| 95 | 85 | } |
|
| 96 | 86 | } |
|
| 97 | 87 | ||