]> git.saurik.com Git - wxWidgets.git/commitdiff
respect xsrc, ysrc parameters in DoBlit() (patch 733961)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Feb 2004 15:02:54 +0000 (15:02 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Feb 2004 15:02:54 +0000 (15:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dc.cpp

index d8cc34d86ed2b46e280803ba2de4668b63eeac29..0dc13d5a1f171185ae2eb8809a8f57f4829ecd3f 100644 (file)
@@ -2065,10 +2065,19 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
             {
                 StretchBltModeChanger changeMode(GetHdc(), COLORONCOLOR);
 
+                // Figure out what co-ordinate system we're supposed to specify
+                // ysrc in.
+                const LONG hDIB = ds.dsBmih.biHeight;
+                if ( hDIB > 0 )
+                {
+                    // reflect ysrc
+                    ysrc = hDIB - (ysrc + height);
+                }
+
                 if ( ::StretchDIBits(GetHdc(),
                                      xdest, ydest,
                                      width, height,
-                                     0, 0,
+                                     xsrc, ysrc,
                                      width, height,
                                      ds.dsBm.bmBits,
                                      (LPBITMAPINFO)&ds.dsBmih,