Skip to content

Commit

Permalink
Fix negative scales (#7739)
Browse files Browse the repository at this point in the history
* Undo accidental change of the NAN operator

* Make sure oblique projection does not have negative scales.
  • Loading branch information
joa-quim authored Aug 18, 2023
1 parent 8f29d5c commit eb98113
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gmt_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -3557,6 +3557,8 @@ GMT_LOCAL int gmtmap_init_oblique (struct GMT_CTRL *GMT, bool *search) {
gmtproj_imerc_sph (GMT, &e, &n, xmax, ymax);
GMT->current.proj.scale[GMT_X] = GMT->current.proj.scale[GMT_Y] = GMT->current.proj.pars[4];
gmtmap_setinfo (GMT, xmin, xmax, ymin, ymax, GMT->current.proj.pars[4]);
GMT->current.proj.scale[GMT_X] = fabs(GMT->current.proj.scale[GMT_X]); /* The may be negatives sometimes */
GMT->current.proj.scale[GMT_Y] = fabs(GMT->current.proj.scale[GMT_Y]);
GMT->current.proj.fwd = &gmtproj_oblmrc;
GMT->current.proj.inv = &gmtproj_ioblmrc;
GMT->current.map.outside = &gmtmap_rect_outside;
Expand Down

0 comments on commit eb98113

Please sign in to comment.