fix some bugs wih org with strechblt.
authorMagnus Olsen <magnus@greatlord.com>
Sun, 1 Jan 2006 17:12:19 +0000 (17:12 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 1 Jan 2006 17:12:19 +0000 (17:12 +0000)
svn path=/trunk/; revision=20521

reactos/subsys/win32k/dib/dib16bpp.c
reactos/subsys/win32k/dib/dib1bpp.c
reactos/subsys/win32k/dib/dib24bpp.c
reactos/subsys/win32k/dib/dib32bpp.c
reactos/subsys/win32k/dib/dib4bpp.c
reactos/subsys/win32k/dib/dib8bpp.c

index 8b19566..1684e3c 100644 (file)
@@ -630,10 +630,10 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
      BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom,
      DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
 
-    SrcSizeY = SourceRect->bottom;
-    SrcSizeX = SourceRect->right;
+    SrcSizeY = SourceRect->bottom - SourceRect->top;
+    SrcSizeX = SourceRect->right - SourceRect->left;
   
-    DesSizeY = DestRect->bottom;
+    DesSizeY = DestRect->bottom ;
     DesSizeX = DestRect->right;     
    
        zoomX = DesSizeX / SrcSizeX;
@@ -659,7 +659,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -670,7 +670,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -692,7 +692,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -703,7 +703,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -728,7 +728,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -739,7 +739,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -759,7 +759,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -770,7 +770,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -797,7 +797,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -808,7 +808,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -826,7 +826,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -837,7 +837,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -859,7 +859,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -870,7 +870,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -886,7 +886,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -897,7 +897,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -921,7 +921,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -932,7 +932,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -950,7 +950,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -961,7 +961,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -983,7 +983,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -994,7 +994,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1010,7 +1010,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1021,7 +1021,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1050,7 +1050,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1061,7 +1061,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1079,7 +1079,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1090,7 +1090,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1112,7 +1112,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1123,7 +1123,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1139,7 +1139,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1150,7 +1150,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1174,7 +1174,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1185,7 +1185,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1203,7 +1203,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1214,7 +1214,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1236,7 +1236,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1247,7 +1247,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1263,7 +1263,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1274,7 +1274,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
index b92f5f2..8bec335 100644 (file)
@@ -518,8 +518,8 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
    int saveY;
    BOOLEAN DesIsBiggerY=FALSE;
 
-   SrcSizeY = SourceRect->bottom;
-    SrcSizeX = SourceRect->right;
+    SrcSizeY = SourceRect->bottom - SourceRect->top;
+    SrcSizeX = SourceRect->right - SourceRect->left;
   
     DesSizeY = DestRect->bottom;
     DesSizeX = DestRect->right;  
@@ -544,7 +544,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -555,7 +555,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -576,7 +576,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -587,7 +587,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -611,7 +611,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -622,7 +622,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -639,7 +639,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); 
@@ -650,7 +650,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);                                                                  
                                        
@@ -675,7 +675,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -686,7 +686,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -704,7 +704,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -715,7 +715,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -737,7 +737,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -748,7 +748,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -764,7 +764,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -775,7 +775,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -799,7 +799,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -810,7 +810,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -828,7 +828,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -839,7 +839,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -861,7 +861,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -872,7 +872,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -888,7 +888,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -899,7 +899,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -923,7 +923,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -934,7 +934,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -952,7 +952,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -963,7 +963,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -985,7 +985,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -996,7 +996,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1012,7 +1012,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1023,7 +1023,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1047,7 +1047,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1058,7 +1058,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1076,7 +1076,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1087,7 +1087,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1109,7 +1109,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1120,7 +1120,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1136,7 +1136,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1147,7 +1147,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1171,7 +1171,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1182,7 +1182,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1200,7 +1200,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1211,7 +1211,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1233,7 +1233,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1244,7 +1244,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1260,7 +1260,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1271,7 +1271,7 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
index 924f38d..960bc8c 100644 (file)
@@ -513,10 +513,10 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
    int saveY;
    BOOLEAN DesIsBiggerY=FALSE;
 
-   SrcSizeY = SourceRect->bottom;
-    SrcSizeX = SourceRect->right;
+    SrcSizeY = SourceRect->bottom - SourceRect->top;
+    SrcSizeX = SourceRect->right - SourceRect->left;
   
-    DesSizeY = DestRect->bottom;
+    DesSizeY = DestRect->bottom ;
     DesSizeX = DestRect->right;  
 
    zoomX = DesSizeX / SrcSizeX;
@@ -538,7 +538,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -549,7 +549,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -571,7 +571,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -582,7 +582,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -607,7 +607,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -618,7 +618,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -638,7 +638,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -649,7 +649,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -676,7 +676,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -687,7 +687,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -705,7 +705,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -716,7 +716,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -738,7 +738,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -749,7 +749,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -765,7 +765,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -776,7 +776,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -800,7 +800,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -811,7 +811,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -829,7 +829,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -840,7 +840,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -862,7 +862,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -873,7 +873,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -889,7 +889,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -900,7 +900,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -924,7 +924,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -935,7 +935,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -953,7 +953,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -964,7 +964,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -986,7 +986,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -997,7 +997,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1013,7 +1013,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1024,7 +1024,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1048,7 +1048,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1059,7 +1059,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1077,7 +1077,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1088,7 +1088,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1110,7 +1110,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1121,7 +1121,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1137,7 +1137,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1148,7 +1148,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1172,7 +1172,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1183,7 +1183,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1201,7 +1201,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1212,7 +1212,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1234,7 +1234,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1245,7 +1245,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1261,7 +1261,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1272,7 +1272,7 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
index c4df9da..d09ebd7 100644 (file)
@@ -557,10 +557,10 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
             BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, 
             SourceRect->bottom, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
 
-    SrcSizeY = SourceRect->bottom;
-    SrcSizeX = SourceRect->right;
+    SrcSizeY = SourceRect->bottom - SourceRect->top;
+    SrcSizeX = SourceRect->right - SourceRect->left;
   
-    DesSizeY = DestRect->bottom;
+    DesSizeY = DestRect->bottom ;
     DesSizeX = DestRect->right;   
 
     zoomX = DesSizeX / SrcSizeX;
@@ -582,7 +582,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -593,7 +593,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -615,7 +615,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -626,7 +626,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -651,7 +651,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -662,7 +662,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -682,7 +682,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -693,7 +693,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -720,7 +720,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -731,7 +731,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -749,7 +749,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -760,7 +760,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -782,7 +782,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -793,7 +793,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -809,7 +809,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -820,7 +820,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -844,7 +844,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -855,7 +855,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -873,7 +873,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -884,7 +884,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -906,7 +906,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -917,7 +917,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -933,7 +933,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -944,7 +944,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -968,7 +968,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -979,7 +979,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -997,7 +997,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1008,7 +1008,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1030,7 +1030,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1041,7 +1041,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1057,7 +1057,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1068,7 +1068,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1092,7 +1092,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1103,7 +1103,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1121,7 +1121,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1132,7 +1132,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1154,7 +1154,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1165,7 +1165,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1181,7 +1181,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1192,7 +1192,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
index d47ce23..3e6f647 100644 (file)
@@ -397,8 +397,8 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
    int saveY;
    BOOLEAN DesIsBiggerY=FALSE;
   
-    SrcSizeY = SourceRect->bottom;
-    SrcSizeX = SourceRect->right;
+    SrcSizeY = SourceRect->bottom - SourceRect->top;
+    SrcSizeX = SourceRect->right - SourceRect->left;
   
     DesSizeY = DestRect->bottom;
     DesSizeX = DestRect->right;   
@@ -422,7 +422,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -433,7 +433,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -455,7 +455,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -466,7 +466,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -491,7 +491,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -502,7 +502,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -522,7 +522,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -533,7 +533,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -560,7 +560,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -571,7 +571,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -589,7 +589,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -600,7 +600,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -622,7 +622,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -633,7 +633,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -649,7 +649,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -660,7 +660,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -684,7 +684,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -695,7 +695,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -713,7 +713,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -724,7 +724,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -746,7 +746,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -757,7 +757,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -773,7 +773,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -784,7 +784,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -808,7 +808,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -819,7 +819,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -837,7 +837,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -848,7 +848,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -870,7 +870,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -881,7 +881,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -897,7 +897,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -908,7 +908,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -932,7 +932,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -943,7 +943,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -961,7 +961,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -972,7 +972,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -994,7 +994,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1005,7 +1005,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1021,7 +1021,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1032,7 +1032,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1056,7 +1056,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1067,7 +1067,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1085,7 +1085,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1096,7 +1096,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1118,7 +1118,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1129,7 +1129,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1145,7 +1145,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1156,7 +1156,7 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
index 32ab9ee..b951a33 100644 (file)
@@ -480,12 +480,14 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
      BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom,
      DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
 
-    SrcSizeY = SourceRect->bottom;
-    SrcSizeX = SourceRect->right;
+    
+    SrcSizeY = SourceRect->bottom - SourceRect->top;
+    SrcSizeX = SourceRect->right - SourceRect->left;
   
-    DesSizeY = DestRect->bottom;
+    DesSizeY = DestRect->bottom ;
     DesSizeX = DestRect->right;   
-
+        
+        
    zoomX = DesSizeX / SrcSizeX;
    if (zoomX==0) zoomX=1;
 
@@ -505,7 +507,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -516,7 +518,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -538,7 +540,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -549,7 +551,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -574,7 +576,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -585,7 +587,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -605,7 +607,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -616,7 +618,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -643,7 +645,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -654,7 +656,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -672,7 +674,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -683,7 +685,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -705,7 +707,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -716,7 +718,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -732,7 +734,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -743,7 +745,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -772,7 +774,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -783,7 +785,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -801,7 +803,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -812,7 +814,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -834,7 +836,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -845,7 +847,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -861,7 +863,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -872,7 +874,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -896,7 +898,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -907,7 +909,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -925,7 +927,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -936,7 +938,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -958,7 +960,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -969,7 +971,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -985,7 +987,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -996,7 +998,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1020,7 +1022,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                     /* Draw one Hline on X - Led to the Des Zoom In*/
                     if (DesSizeX>SrcSizeX)
                         {
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1031,7 +1033,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1049,7 +1051,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                         {
                           /* Draw one Hline on X - Led to the Des Zoom Out*/
 
-               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1060,7 +1062,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);                                                                  
                                        
@@ -1082,7 +1084,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                    if (DesSizeX>SrcSizeX)
                        {
                                /* Draw one pixel on X - Led to the Des Zoom In*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1093,7 +1095,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {                                               
                                                sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
                                                
@@ -1109,7 +1111,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
                        else
                        {
                                /* Draw one pixel on X - Led to the Des Zoom Out*/
-                               for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
+                               for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY)
                                {
                                        if (DesIsBiggerY)
                                                sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
@@ -1120,7 +1122,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
 
                                        saveY = DesY+zoomY;
 
-                                       for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)                          
+                                       for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX)                             
                                        {
                                                sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);