From 26b4776394725e82d043740651562682771a27bf Mon Sep 17 00:00:00 2001 From: torsten Date: Fri, 27 Mar 2009 22:38:54 +0000 Subject: [PATCH] fix wrong bucket calculation for western hemisphere, close to poles, full-degree-longitude calculations. set_bucket computed false left border, if the span was greater than 1, longitudes were less than zero and longitudes were within SG_EPSILON on a full degree. Example: -179.0, +87.5 returned -176, 87 but should return -180, 87. Discovered by Brian Schack --- simgear/bucket/newbucket.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simgear/bucket/newbucket.cxx b/simgear/bucket/newbucket.cxx index 9a4b20eb..11995903 100644 --- a/simgear/bucket/newbucket.cxx +++ b/simgear/bucket/newbucket.cxx @@ -106,7 +106,7 @@ void SGBucket::set_bucket( double dlon, double dlat ) { } else if ( span <= 1.0 ) { x = (int)((dlon - lon) / span); } else { - if ( (dlon >= 0) || (fabs(diff) < SG_EPSILON) ) { + if ( dlon >= 0 ) { lon = (int)( (int)(lon / span) * span); } else { // cout << " lon = " << lon -- 2.39.5