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

This commit is contained in:
Randy Weems 1999-03-25 15:49:11 +00:00 committed by Alexandre Julliard
parent 1d70e4ac8a
commit 0bc73c7818
2 changed files with 14 additions and 4 deletions

View File

@ -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));

View File

@ -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(
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 );