mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-07 20:40:16 +01:00
dix: improve comment, directions flagged are 45° each
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 <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
e804ae85fe
commit
7513190ec7
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue