From debf614958b2c5a2661201ee079a9a64037da32a Mon Sep 17 00:00:00 2001 From: tobias Date: Wed, 22 Jan 2020 13:17:50 +0100 Subject: [PATCH] Prevents indefinte loop when aperture is on 0. --- src/mad_aper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mad_aper.c b/src/mad_aper.c index 0735ba97a..572880909 100644 --- a/src/mad_aper.c +++ b/src/mad_aper.c @@ -1149,7 +1149,7 @@ aper_calc(double p, double q, double* minhl, if ( // not parallel lines 0 != aper_intersect(a1, b1, c1, a2, b2, c2, &xm, &ym) // intersection point is inside the bounding box - && ( xm < bbxmax && xm > bbxmin && ym < bbymax && ym > bbymin) + && ( xm <= bbxmax && xm >= bbxmin && ym <= bbymax && ym >= bbymin) // intersection point is inside pipe line segment && 0 != aper_on_line(xm, ym, pipex[i], pipey[i], pipex[i+1], pipey[i+1], dist_limit) // halo center is not inside segement defined by halo apex and intersection point