for (i = sgrid; i <= egrid; i++){
double Y0=ytr(im,im->ygrid_scale.gridstep*i);
double YN=ytr(im,im->ygrid_scale.gridstep*(i+1));
- if ( round(Y0) >= im->yorigin-im->ysize
- && round(Y0) <= im->yorigin){
+ if ( floor(Y0+0.5) >= im->yorigin-im->ysize
+ && floor(Y0+0.5) <= im->yorigin){
/* Make sure at least 2 grid labels are shown, even if it doesn't agree
with the chosen settings. Add a label if required by settings, or if
there is only one label so far and the next grid line is out of bounds. */
pre_value = value;
Y0 = ytr(im, value);
- if(round(Y0) <= im->yorigin - im->ysize) break;
+ if(floor(Y0+0.5) <= im->yorigin - im->ysize) break;
/* major grid line */
gfx_new_dashed_line ( im->canvas,
if(value < im->minval) continue;
Y0 = ytr(im, value);
- if(round(Y0) <= im->yorigin - im->ysize) break;
+ if(floor(Y0+0.5) <= im->yorigin - im->ysize) break;
/* draw lines */
gfx_new_dashed_line ( im->canvas,
if(value < im->minval) continue;
Y0 = ytr(im, value);
- if(round(Y0) <= im->yorigin - im->ysize) break;
+ if(floor(Y0+0.5) <= im->yorigin - im->ysize) break;
/* draw lines */
gfx_new_dashed_line ( im->canvas,
if(value < im->minval) continue;
Y0 = ytr(im, value);
- if(round(Y0) <= im->yorigin - im->ysize) break;
+ if(floor(Y0+0.5) <= im->yorigin - im->ysize) break;
/* draw lines */
gfx_new_dashed_line ( im->canvas,
if(value < im->minval) continue;
Y0 = ytr(im, value);
- if(round(Y0) <= im->yorigin - im->ysize) break;
+ if(floor(Y0+0.5) <= im->yorigin - im->ysize) break;
/* draw lines */
gfx_new_dashed_line ( im->canvas,