Ticket #41226: patch-grdvector.diff
File patch-grdvector.diff, 1.2 KB (added by florian@…, 11 years ago) |
---|
-
src/grdvector.c
388 388 if (!Ctrl->N.active) GMT_map_clip_on (GMT_no_rgb, 3); 389 389 390 390 if (Ctrl->I.xinc != 0.0 && Ctrl->I.yinc != 0.0) { /* Gave a coarser grid spacing, we hope */ 391 struct GRD_HEADER tmp_h; 392 double val; 393 tmp_h = h[0]; 394 tmp_h.x_inc = Ctrl->I.xinc; 395 tmp_h.y_inc = Ctrl->I.yinc; 396 GMT_RI_prepare (&tmp_h); /* Convert to make sure we have correct increments */ 397 Ctrl->I.xinc = tmp_h.x_inc; 398 Ctrl->I.yinc = tmp_h.y_inc; 399 val = Ctrl->I.yinc / h[0].y_inc; 391 double val = Ctrl->I.yinc / h[0].y_inc; 400 392 dj = irint (val); 401 393 if (dj == 0 || fabs (val - dj) > GMT_CONV_LIMIT) { 402 394 fprintf (stderr, "%s: Error: New y grid increment (%g) is not a multiple of actual grid increment (%g).\n", GMT_program, Ctrl->I.xinc, h[0].x_inc); … … 408 400 fprintf (stderr, "%s: Error: New x grid increment (%g) is not a multiple of actual grid increment (%g).\n", GMT_program, Ctrl->I.xinc, h[0].x_inc); 409 401 exit (EXIT_FAILURE); 410 402 } 403 /* Determine starting point for straddled access */ 411 404 tmp = ceil (h[0].y_max / Ctrl->I.yinc) * Ctrl->I.yinc; 412 405 if (tmp > h[0].y_max) tmp -= Ctrl->I.yinc; 413 406 j0 = irint ((h[0].y_max - tmp) / h[0].y_inc);