X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f26e88002c5b81ac8d96f62774ec9b176a8c0d0..09e7316547fadf0998abd9eade215db7845538dd:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 7c8b06997b..c7f3cfa665 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -2246,13 +2246,6 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest, return false; } - // We need to interpret source-related coordinates in source DC - // coordinate system. - xsrc = source->LogicalToDeviceX(xsrc); - ysrc = source->LogicalToDeviceY(ysrc); - srcWidth = source->LogicalToDeviceXRel(srcWidth); - srcHeight = source->LogicalToDeviceYRel(srcHeight); - const HDC hdcSrc = GetHdcOf(*implSrc); // if either the source or destination has alpha channel, we must use @@ -2449,6 +2442,17 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest, { SET_STRETCH_BLT_MODE(GetHdc()); + // Unlike all the other functions used here (i.e. AlphaBlt(), + // MaskBlt(), BitBlt() and StretchBlt()), StretchDIBits() does + // not take into account the source DC logical coordinates + // automatically as it doesn't even work with the source HDC. + // So do this manually to ensure that the coordinates are + // interpreted in the same way here as in all the other cases. + xsrc = source->LogicalToDeviceX(xsrc); + ysrc = source->LogicalToDeviceY(ysrc); + srcWidth = source->LogicalToDeviceXRel(srcWidth); + srcHeight = source->LogicalToDeviceYRel(srcHeight); + // Figure out what co-ordinate system we're supposed to specify // ysrc in. const LONG hDIB = ds.dsBmih.biHeight;