Skip to content

Commit

Permalink
Revert #7739 that caused side effects but fix negative scales when gu…
Browse files Browse the repository at this point in the history
…essing -D resolution. (#7756)
  • Loading branch information
joa-quim authored Aug 23, 2023
1 parent 71afceb commit a4c827a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/gmt_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -3557,8 +3557,6 @@ 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
2 changes: 1 addition & 1 deletion src/gmt_shore.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ int gmt_set_resolution (struct GMT_CTRL *GMT, char *res, char opt) {
switch (*res) {
case 'a': /* Automatic selection via -J or -R, if possible */
if (GMT->common.J.active && !gmt_M_is_linear (GMT)) { /* Use map scale xxxx as in 1:xxxx */
double i_scale = 1.0 / (0.0254 * GMT->current.proj.scale[GMT_X]);
double i_scale = 1.0 / (0.0254 * fabs(GMT->current.proj.scale[GMT_X]));
if (i_scale > GMT_CRUDE_THRESHOLD)
base = 4; /* crude */
else if (i_scale > GMT_LOW_THRESHOLD)
Expand Down

0 comments on commit a4c827a

Please sign in to comment.