wmii

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

quadrant.c (369B)


      1 /* Copyright ©2006-2010 Kris Maglione <maglione.k at Gmail>
      2  * See LICENSE file for license details.
      3  */
      4 #include <stuff/geom.h>
      5 
      6 Align
      7 quadrant(Rectangle r, Point pt) {
      8 	Align ret;
      9 
     10 	pt = subpt(pt, r.min);
     11 	ret = East  * (pt.x >= Dx(r) * .7)
     12 	    | West  * (pt.x <= Dx(r) * .3)
     13 	    | South * (pt.y >= Dy(r) * .7)
     14 	    | North * (pt.y <= Dy(r) * .3);
     15 
     16 	return ret;
     17 }