changeset: 2770:8b5f415a90fb
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Wed Jul 21 10:08:01 2010 -0400
files: lib/libstuff/geom/quadrant.c
description:
Fix quadrant(). Closes issue #210.
diff -r d1296b42f38a -r 8b5f415a90fb lib/libstuff/geom/quadrant.c
--- a/lib/libstuff/geom/quadrant.c Mon Jul 19 12:50:19 2010 -0400
+++ b/lib/libstuff/geom/quadrant.c Wed Jul 21 10:08:01 2010 -0400
@@ -8,16 +8,10 @@
Align ret;
pt = subpt(pt, r.min);
- ret = 0;
-
- if(pt.x >= Dx(r) * .5)
- ret |= East;
- if(pt.x <= Dx(r) * .5)
- ret |= West;
- if(pt.y <= Dy(r) * .5)
- ret |= North;
- if(pt.y >= Dy(r) * .5)
- ret |= South;
+ ret = East * (pt.x >= Dx(r) * .5)
+ | West * (pt.x < Dx(r) * .5)
+ | South * (pt.y >= Dy(r) * .5)
+ | North * (pt.y < Dy(r) * .5);
return ret;
}
Received on Wed Jul 21 2010 - 16:08:23 CEST
This archive was generated by hypermail 2.2.0 : Wed Jul 21 2010 - 16:12:04 CEST