From 7513190ec7bc08db1629b04d3f88f86ea2b1588e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 20 Apr 2011 11:47:21 +1000 Subject: [PATCH] =?UTF-8?q?dix:=20improve=20comment,=20directions=20flagge?= =?UTF-8?q?d=20are=2045=C2=B0=20each?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two directions returned by this calculation are always the two boundary conditions. Since we don't do quadrants but octants, the flagged ones are 45° each. e.g. an angle of 35° flags E and NE. Signed-off-by: Peter Hutterer Reviewed-by: Jamey Sharp Reviewed-by: Daniel Stone --- dix/ptrveloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index e95ccbe47..3bf871658 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -486,7 +486,7 @@ DoGetDirection(int dx, int dy){ /* find direction. We avoid r to become negative, * since C has no well-defined modulo for such cases. */ r = (r+(M_PI*2.5))/(M_PI/4); - /* this intends to flag 2 directions (90 degrees), + /* this intends to flag 2 directions (45 degrees each), * except on very well-aligned mickeys. */ i1 = (int)(r+0.1) % 8; i2 = (int)(r+0.9) % 8;