if (!skipHorizontal && !skipVertical)
if (!skipHorizontal && !skipVertical) {
XlibRectStretch(PRInt32 srcWidth, PRInt32 srcHeight,                PRInt32 dstWidth, PRInt32 dstHeight,                PRInt32 dstOrigX, PRInt32 dstOrigY,                PRInt32 aDX, PRInt32 aDY,                PRInt32 aDWidth, PRInt32 aDHeight,                GdkPixmap *aSrcImage, GdkPixmap *aDstImage,                GdkGC *gc, GdkGC *copygc, PRInt32 aDepth){  long dx,dy,e,d,dx2;  short sx,sy;  GdkPixmap *aTmpImage = 0;  PRBool skipHorizontal=PR_FALSE, skipVertical=PR_FALSE;  long startColumn, startRow, endColumn, endRow;  long xs1, ys1, xs2, ys2, xd1, yd1, xd2, yd2;  xs1 = ys1 = xd1 = yd1 = 0;  xs2 = srcWidth-1;  ys2 = srcHeight-1;  xd2 = dstWidth-1;  yd2 = dstHeight-1;//  fprintf(stderr, "XRS %p (%ld %ld)-(%ld %ld) (%ld %ld)-(%ld %ld)\n",//          (void *)aDstImage, xs1, ys1, xs2, ys2, xd1, yd1, xd2, yd2);    startColumn = aDX-dstOrigX;  startRow    = aDY-dstOrigY;  endColumn   = aDX+aDWidth-dstOrigX;  endRow      = aDY+aDHeight-dstOrigY;//  fprintf(stderr, "startXY = %d %d  endXY = %d %d   %d x %d\n",//          startColumn, startRow, endColumn, endRow,//          endColumn-startColumn, endRow-startRow);  long scaleStartY, scaleEndY;  scaleStartY = startRow * (ys2-ys1+1) / (yd2-yd1+1);  scaleEndY   = 1 + endRow * (ys2-ys1+1) / (yd2-yd1+1);  if (xd2-xd1 == xs2-xs1) {//    fprintf(stderr, "skipping horizontal\n");    skipHorizontal = PR_TRUE;    aTmpImage = aSrcImage;    scaleStartY = 0;    scaleEndY = ys2;  }  if (yd2-yd1 == ys2-ys1) {//    fprintf(stderr, "skipping vertical\n");    skipVertical = PR_TRUE;    aTmpImage = aDstImage;  }  if (skipVertical && skipHorizontal) {    gdk_draw_pixmap(aDstImage, gc, aSrcImage,                    0, 0, srcWidth, srcHeight,                    dstOrigX, dstOrigY);    return;  }//  fprintf(stderr, "scaleY Start/End = %d %d\n", scaleStartY, scaleEndY);  if (!skipHorizontal && !skipVertical)    aTmpImage = gdk_pixmap_new(nsnull,                               endColumn-startColumn,                               scaleEndY-scaleStartY,                               aDepth);    dx = abs((int)(yd2-yd1));  dy = abs((int)(ys2-ys1));  sx = sign(yd2-yd1);  sy = sign(ys2-ys1);  e = dy-dx;  dx2 = dx;  dy += 1;  if (!dx2) dx2=1;  if (!skipHorizontal)    XlibStretchHorizontal(xd1, xd2, xs1, xs2, scaleStartY, scaleEndY,                          startColumn, endColumn,                          (skipVertical?MAX(dstOrigX,0):0),(skipVertical?MAX(dstOrigY,0):0),                          aSrcImage, aTmpImage, (skipVertical?gc:copygc));    if (!skipVertical) {    for (d=0; d<=dx; d++) {      if ((yd1 >= startRow) && (yd1 <= endRow)) {        gdk_draw_pixmap(aDstImage, gc, aTmpImage,                        (skipHorizontal?startColumn:0), ys1-scaleStartY,                        (dstOrigX>0?dstOrigX:0), dstOrigY+yd1,                        endColumn-startColumn, 1);      }      while (e>=0) {	      ys1 += sy;	      e -= dx2;      }      yd1 += sx;      e += dy;    }  }  if (!skipHorizontal && !skipVertical)    gdk_pixmap_unref(aTmpImage);}