for (j=y2-1; j>y1; j--) {
for (j=y2-1; j>=y1; j--) {
void do_copyregion(sraRegionPtr region, int dx, int dy)  {	sraRectangleIterator *iter;	sraRect rect;	int Bpp = bpp/8;	int x1, y1, x2, y2, w, stride;	int sx1, sy1, sx2, sy2, sdx, sdy;	int req, mod, cpy, ncli;	char *dst, *src;	if (!scaling || rfb_fb == main_fb) {		/* normal case */		get_client_regions(&req, &mod, &cpy, &ncli);if (debug_scroll > 1) fprintf(stderr, "<<<-rfbDoCopyRect req: %d mod: %d cpy: %d\n", req, mod, cpy); 		rfbDoCopyRegion(screen, region, dx, dy);		get_client_regions(&req, &mod, &cpy, &ncli);if (debug_scroll > 1) fprintf(stderr, ">>>-rfbDoCopyRect req: %d mod: %d cpy: %d\n", req, mod, cpy); 		return;	}	/* rarer case, we need to call rfbDoCopyRect with scaled xy */	stride = dpy_x * Bpp;	iter = sraRgnGetIterator(region);	while(sraRgnIteratorNext(iter, &rect)) {		int j;		x1 = rect.x1;		y1 = rect.y1;		x2 = rect.x2;		y2 = rect.y2;		w = (x2 - x1)*Bpp; 		dst = main_fb + y1*stride + x1*Bpp;		src = main_fb + (y1-dy)*stride + (x1-dx)*Bpp;		if (dy < 0) {			for (j=y1; j<y2; j++) {				memmove(dst, src, w);				dst += stride;				src += stride;			}		} else {			dst += (y2 - y1 - 1)*stride;			src += (y2 - y1 - 1)*stride;			for (j=y2-1; j>y1; j--) {				memmove(dst, src, w);				dst -= stride;				src -= stride;			}		}		sx1 = ((double) x1 / dpy_x) * scaled_x;		sy1 = ((double) y1 / dpy_y) * scaled_y;		sx2 = ((double) x2 / dpy_x) * scaled_x;		sy2 = ((double) y2 / dpy_y) * scaled_y;		sdx = ((double) dx / dpy_x) * scaled_x;		sdy = ((double) dy / dpy_y) * scaled_y;		rfbDoCopyRect(screen, sx1, sy1, sx2, sy2, sdx, sdy);	}	sraRgnReleaseIterator(iter);}