Skip to content

Commit

Permalink
Improve the test that checks if central lon is < |180|
Browse files Browse the repository at this point in the history
  • Loading branch information
joa-quim committed Mar 16, 2024
1 parent 9ca3c58 commit 7d6247d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gmt_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ GMT_LOCAL int gmtmap_cyl_validate_clon (struct GMT_CTRL *GMT, unsigned int mode)
bool is_reg0360 = GMT->common.R.wesn[XLO] > 180 || GMT->common.R.wesn[XHI] > 180; /* Is the region in the [0 360] range */

clon = GMT->current.proj.pars[0];
if (is_clon0360 && !is_reg0360) /* Must take care of not checking for clon < 180 from either boundary and mix -Rg & -Rd */
if (is_clon0360 && !is_reg0360 && clon > 180) /* Must take care of not checking for clon < 180 from either boundary and mix -Rg & -Rd */
clon -= 360.0;
else if (!is_clon0360 && is_reg0360)
else if (!is_clon0360 && is_reg0360 && clon < 0)
clon += 360.0;
dw = fabs (clon - GMT->common.R.wesn[XLO]); if (dw >= 360) dw -= 360.0;
de = fabs (clon - GMT->common.R.wesn[XHI]); if (de >= 360) de -= 360.0;
Expand Down

0 comments on commit 7d6247d

Please sign in to comment.