diff options
author | Connor Lane Smith <cls@lubutu.com> | 2011-05-15 21:54:26 +0100 |
---|---|---|
committer | Connor Lane Smith <cls@lubutu.com> | 2011-05-15 21:54:26 +0100 |
commit | 11ea52d1709423e0f4e6702aaee2dff2a3b0107e (patch) | |
tree | b850f8349e91a48ff541aa2c97417b2f3b805d41 /draw.c | |
parent | 43540746077d4fd8ef963b5939934d32d59c9417 (diff) |
portability
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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) { - 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); } |