X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7b30ac82dd01b5ca4fd1db2f2889b7714ad1577c..f222db9ce69b094c7657a9e98e1a795be1adf1ac:/src/gtk/dcclient.cpp diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 588fbb5501..3b9379fb3e 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -415,6 +415,7 @@ bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const memdc.SelectObject(bitmap); memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1); memdc.SelectObject(wxNullBitmap); + wxImage image(bitmap); col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0)); return TRUE; @@ -1333,14 +1334,14 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) wxCHECK_RET( font, wxT("invalid font") ); -#ifdef __WXGTK20__ +#if defined(__WXGTK20__) wxCHECK_RET( m_context, wxT("no Pango context") ); #endif x = XLOG2DEV(x); y = YLOG2DEV(y); -#ifdef __WXGTK20__ +#if defined(__WXGTK20__) && wxUSE_WCHAR_T /* FIXME: the layout engine should probably be abstracted at a higher level in wxDC... */ PangoLayout *layout = pango_layout_new(m_context); pango_layout_set_font_description(layout, m_fontdesc); @@ -1377,7 +1378,7 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y); } -#ifdef __WXGTK20__ +#if defined(__WXGTK20__) && wxUSE_WCHAR_T g_object_unref( G_OBJECT( layout ) ); #endif @@ -2040,7 +2041,7 @@ void wxWindowDC::ComputeScaleAndOrigin() // Resolution in pixels per logical inch wxSize wxWindowDC::GetPPI() const { - return wxSize(100, 100); + return wxSize( (int) (m_mm_to_pix_x * 25.4 + 0.5), (int) (m_mm_to_pix_y * 25.4 + 0.5)); } int wxWindowDC::GetDepth() const