X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2dcf60dab4d60daeeb59b54d96e67006c75f25a8..c0c05e79b20d6ca372ece6ac5995b0e3db18a29b:/src/gtk/dcclient.cpp diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 4b4b7fbf11..0ac7173e3d 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -269,6 +269,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) : m_font = window->GetFont(); GtkWidget *widget = window->m_wxwindow; + m_gdkwindow = window->GTKGetDrawingWindow(); // Some controls don't have m_wxwindow - like wxStaticBox, but the user // code should still be able to create wxClientDCs for them @@ -278,6 +279,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) : wxCHECK_RET(widget, "DC needs a widget"); + m_gdkwindow = widget->window; if (GTK_WIDGET_NO_WINDOW(widget)) SetDeviceLocalOrigin(widget->allocation.x, widget->allocation.y); } @@ -286,8 +288,6 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) : m_layout = pango_layout_new( m_context ); m_fontdesc = pango_font_description_copy( widget->style->font_desc ); - m_gdkwindow = widget->window; - // Window not realized ? if (!m_gdkwindow) { @@ -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);