From: Vadim Zeitlin Date: Wed, 3 Feb 2010 21:07:42 +0000 (+0000) Subject: Correct the bounding box calculation in wxGTK wxDC::DrawBitmap(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/15b850072622e84759c9592e1e591ecdee4aee1c Correct the bounding box calculation in wxGTK wxDC::DrawBitmap(). 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 --- diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 4b4b7fbf11..0f3cd68a25 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -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);