changeset 1244:db26b9622769

Fixed dw_pixmap_stretch_bitblt() on OS/2. Also cleaned up the code... I think in some instances it may have been wrong for regular bitblt too.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 19 Oct 2011 08:55:24 +0000
parents c191a562c14a
children 3a2ffe3a7eae
files os2/dw.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Wed Oct 19 08:14:05 2011 +0000
+++ b/os2/dw.c	Wed Oct 19 08:55:24 2011 +0000
@@ -8970,6 +8970,10 @@
    int dheight, sheight;
    int count = 3;
    
+   /* Do some sanity checks */
+   if((srcheight == -1 || srcwidth == -1) && srcheight != srcwidth)
+      return DW_ERROR_GENERAL;
+
    if(dest)
    {
       hpsdest = WinGetPS(dest);
@@ -9001,16 +9005,16 @@
    }
 
    ptl[0].x = xdest;
-   ptl[0].y = (dheight - ydest) - height;
-   ptl[1].x = ptl[0].x + width;
+   ptl[0].y = dheight - (ydest + height);
+   ptl[1].x = xdest + width;
    ptl[1].y = dheight - ydest;
    ptl[2].x = xsrc;
-   ptl[2].y = sheight - (ysrc + height);
-   if(srcwidth != -1 && srcheigth != -1)
+   ptl[2].y = sheight - (ysrc + (srcheight != -1 ? srcheight : height));
+   if(srcwidth != -1 && srcheight != -1)
    {
       count = 4;
-      ptl[3].x = ptl[2].x + srcwidth;
-      ptl[3].y = ptl[2].y + srcheight;
+      ptl[3].x = xsrc + srcwidth;
+      ptl[3].y = sheight - ysrc;
    }
 
    /* Handle transparency if requested */