aboutsummaryrefslogtreecommitdiff
path: root/src/pj_transform.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pj_transform.c')
-rw-r--r--src/pj_transform.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pj_transform.c b/src/pj_transform.c
index 07b84f80..c64b410f 100644
--- a/src/pj_transform.c
+++ b/src/pj_transform.c
@@ -268,17 +268,17 @@ int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset,
/* If a wrapping center other than 0 is provided, rewrap around */
/* the suggested center (for latlong coordinate systems only). */
/* -------------------------------------------------------------------- */
- else if( dstdefn->is_latlong && dstdefn->long_wrap_center != 0 )
+ else if( dstdefn->is_latlong && dstdefn->is_long_wrap_set )
{
for( i = 0; i < point_count; i++ )
{
if( x[point_offset*i] == HUGE_VAL )
continue;
- while( x[point_offset*i] < dstdefn->long_wrap_center - HALFPI )
- x[point_offset*i] += PI;
- while( x[point_offset*i] > dstdefn->long_wrap_center + HALFPI )
- x[point_offset*i] -= PI;
+ while( x[point_offset*i] < dstdefn->long_wrap_center - PI )
+ x[point_offset*i] += TWOPI;
+ while( x[point_offset*i] > dstdefn->long_wrap_center + PI )
+ x[point_offset*i] -= TWOPI;
}
}