]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct the bounding box calculation in wxGTK wxDC::DrawBitmap().
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 3 Feb 2010 21:07:42 +0000 (21:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 3 Feb 2010 21:07:42 +0000 (21:07 +0000)
Take into account the axis direction when calculating the bounding box.

This is consistent with not reversing the bitmap even when the axis are
reversed which is probably the expected behaviour.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dcclient.cpp

index 4b4b7fbf11cd1085c94b6928b96fd3f92501bc25..0f3cd68a25ad3eb64a629f33ef99a27c97e6d1dc 100644 (file)
@@ -1059,8 +1059,11 @@ void wxWindowDCImpl::DoDrawBitmap( const wxBitmap &bitmap,
     const int w = bitmap.GetWidth();
     const int h = bitmap.GetHeight();
 
+    // notice that as the bitmap is not drawn upside down (or right to left)
+    // even if the corresponding axis direction is inversed, we need to take it
+    // into account when calculating its bounding box
     CalcBoundingBox(x, y);
-    CalcBoundingBox(x + w, y + h);
+    CalcBoundingBox(x + m_signX*w, y + m_signY*h);
 
     // device coords
     int xx = LogicalToDeviceX(x);