1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2024-12-22 23:26:27 +02:00

cameo/area.c (hit_segment): clean up entry/exit handling

This commit is contained in:
Werner Almesberger 2012-03-20 19:18:08 -03:00
parent d79424d9ae
commit ebcdfd52ca

View File

@ -167,9 +167,8 @@ static int hit_segment(double fx, double fy, double tx, double ty,
dx = b->x-a->x;
dy = b->y-a->y;
if (enter && dy < 0)
return 0;
if (!enter && dy > 0)
/* -dy becomes the x component of the normal vector */
if (enter ? dy < 0 : dy > 0)
return 0;
d = hypot(dx, dy);