wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

border.c (449B)


      1 /* Copyright ©2007-2010 Kris Maglione <maglione.k at Gmail>
      2  * See LICENSE file for license details.
      3  */
      4 #include "../x11.h"
      5 
      6 void
      7 border(Image *dst, Rectangle r, int w, Color *col) {
      8 	if(w == 0)
      9 		return;
     10 
     11 	r = insetrect(r, w/2);
     12 	r.max.x -= w%2;
     13 	r.max.y -= w%2;
     14 
     15 	XSetLineAttributes(display, dst->gc, w, LineSolid, CapButt, JoinMiter);
     16 	setgccol(dst, col);
     17 	XDrawRectangle(display, dst->xid, dst->gc,
     18 		       r.min.x, r.min.y, Dx(r), Dy(r));
     19 }