Really fix source coordinates handling in wxDC::Blit() in wxMSW.

It turns out that the changes r71028 were unnecessary (and actually harmful)
in most cases, they're only needed when a DIB is used as a source DC. So move
the manual coordinates adjustments to the branch of code using StretchDIBits()
and don't do it anywhere else.

Also don't list this as an incompatible change as wxMSW actually already
worked as the other ports in the majority of cases and list it as a simple bug
fix instead.

Closes #14188.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71095 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-04-05 13:55:43 +00:00
parent cb9582cdf6
commit 3caee5cfaa
2 changed files with 12 additions and 10 deletions

View File

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