From c76dc2ccdf833782380ee926da957c6a3e4c8c29 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Mon, 24 Jan 2011 04:35:40 +0000 Subject: [PATCH] Fix off-by-one-half calculating ray distances --- src/plugins/level2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/level2.c b/src/plugins/level2.c index dec504a..906561a 100644 --- a/src/plugins/level2.c +++ b/src/plugins/level2.c @@ -166,8 +166,8 @@ void aweather_level2_draw(GritsObject *_self, GritsOpenGL *opengl) double lx = sin(angle); double ly = cos(angle); - double near_dist = ray->h.range_bin1; - double far_dist = ray->h.nbins*ray->h.gate_size + ray->h.range_bin1; + double near_dist = ray->h.range_bin1 - ((double)ray->h.gate_size/2.); + double far_dist = near_dist + (double)ray->h.nbins*ray->h.gate_size; /* (find middle of bin) / scale for opengl */ // near left -- 2.43.2