--- ray/src/px/pcomb.c 2007/10/22 17:56:36 2.40 +++ ray/src/px/pcomb.c 2007/11/05 23:40:26 2.41 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: pcomb.c,v 2.40 2007/10/22 17:56:36 greg Exp $"; +static const char RCSid[] = "$Id: pcomb.c,v 2.41 2007/11/05 23:40:26 greg Exp $"; #endif /* * Combine picture files according to calcomp functions. @@ -398,7 +398,7 @@ combine(void) /* combine pictures */ advance(); varset(vypos, '=', (double)ypos); for (xpos = 0; xpos < xres; xpos++) { - xscan = (long)xpos*xmax/xres; + xscan = (xpos+.5)*xmax/xres - .4999; varset(vxpos, '=', (double)xpos); eclock++; if (brtdef != NULL) { @@ -437,7 +437,7 @@ advance(void) /* read in data for next scanline */ register COLOR *st; register int i, j; - for (ytarget = (long)ypos*ymax/yres; yscan > ytarget; yscan--) + for (ytarget = (ypos+.5)*ymax/yres - .4999; yscan > ytarget; yscan--) for (i = 0; i < nfiles; i++) { st = input[i].scan[WINSIZ-1]; for (j = WINSIZ-1; j > 0; j--) /* rotate window */