Commit 0bc73c78 authored by Randy Weems's avatar Randy Weems Committed by Alexandre Julliard

Fixed off-by-one error if bitblt width or height is negative.

parent 1d70e4ac
...@@ -1115,6 +1115,16 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst, ...@@ -1115,6 +1115,16 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
X11DRV_PDEVICE *physDevSrc = NULL; X11DRV_PDEVICE *physDevSrc = NULL;
X11DRV_PDEVICE *physDevDst = (X11DRV_PDEVICE *)dcDst->physDev; X11DRV_PDEVICE *physDevDst = (X11DRV_PDEVICE *)dcDst->physDev;
/* compensate for off-by-one shifting for negative widths and heights */
if (widthDst < 0)
++xDst;
if (heightDst < 0)
++yDst;
if (widthSrc < 0)
++xSrc;
if (heightSrc < 0)
++ySrc;
if(dcSrc) physDevSrc = (X11DRV_PDEVICE *)dcSrc->physDev; if(dcSrc) physDevSrc = (X11DRV_PDEVICE *)dcSrc->physDev;
usePat = (((rop >> 4) & 0x0f0000) != (rop & 0x0f0000)); usePat = (((rop >> 4) & 0x0f0000) != (rop & 0x0f0000));
useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000)); useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000));
......
...@@ -1229,9 +1229,9 @@ static void NC_DrawFrame( HDC hdc, RECT *rect, BOOL dlgFrame, ...@@ -1229,9 +1229,9 @@ static void NC_DrawFrame( HDC hdc, RECT *rect, BOOL dlgFrame,
rect->right - rect->left, height, PATCOPY ); rect->right - rect->left, height, PATCOPY );
PatBlt( hdc, rect->left, rect->top, PatBlt( hdc, rect->left, rect->top,
width, rect->bottom - rect->top, PATCOPY ); width, rect->bottom - rect->top, PATCOPY );
PatBlt( hdc, rect->left, rect->bottom, PatBlt( hdc, rect->left, rect->bottom - 1,
rect->right - rect->left, -height, PATCOPY ); rect->right - rect->left, -height, PATCOPY );
PatBlt( hdc, rect->right, rect->top, PatBlt( hdc, rect->right - 1, rect->top,
-width, rect->bottom - rect->top, PATCOPY ); -width, rect->bottom - rect->top, PATCOPY );
if (dlgFrame) if (dlgFrame)
...@@ -1331,9 +1331,9 @@ static void NC_DrawFrame95( ...@@ -1331,9 +1331,9 @@ static void NC_DrawFrame95(
rect->right - rect->left, height, PATCOPY ); rect->right - rect->left, height, PATCOPY );
PatBlt( hdc, rect->left, rect->top, PatBlt( hdc, rect->left, rect->top,
width, rect->bottom - rect->top, PATCOPY ); width, rect->bottom - rect->top, PATCOPY );
PatBlt( hdc, rect->left, rect->bottom, PatBlt( hdc, rect->left, rect->bottom - 1,
rect->right - rect->left, -height, PATCOPY ); rect->right - rect->left, -height, PATCOPY );
PatBlt( hdc, rect->right, rect->top, PatBlt( hdc, rect->right - 1, rect->top - 1,
-width, rect->bottom - rect->top, PATCOPY ); -width, rect->bottom - rect->top, PATCOPY );
InflateRect( rect, -width, -height ); InflateRect( rect, -width, -height );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment