X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6db90681cf0b58209a061561f5d3624f6eda8024..8736a9a0d3edd5dec7cf179c3ea74249e7b6182d:/src/gtk/dcclient.cpp?ds=inline diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 560c4162ef..649070a915 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -111,11 +111,11 @@ wxWindowDC::wxWindowDC( wxWindow *window ) m_owner = (wxWindow *)NULL; m_isMemDC = FALSE; - wxASSERT_MSG( window, "DC needs a window" ); + wxASSERT_MSG( window, _T("DC needs a window") ); GtkWidget *widget = window->m_wxwindow; - wxASSERT_MSG( widget, "DC needs a widget" ); + wxASSERT_MSG( widget, _T("DC needs a widget") ); m_window = widget->window; @@ -487,8 +487,6 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, wxCHECK_RET( bitmap.Ok(), _T("invalid bitmap") ); - if (!m_window) return; - /* scale/translate size and position */ int xx = XLOG2DEV(x); @@ -497,6 +495,11 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, int w = bitmap.GetWidth(); int h = bitmap.GetHeight(); + CalcBoundingBox( x, y ); + CalcBoundingBox( x + w, y + h ); + + if (!m_window) return; + int ww = XLOG2DEVREL(w); int hh = YLOG2DEVREL(h); @@ -550,9 +553,6 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL ); gdk_gc_set_clip_origin( m_penGC, 0, 0 ); } - - CalcBoundingBox( x, y ); - CalcBoundingBox( x + w, y + h ); } bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height, @@ -1025,7 +1025,7 @@ void wxWindowDC::SetLogicalFunction( int function ) #endif default: { - wxFAIL_MSG( "unsupported logical function" ); + wxFAIL_MSG( _T("unsupported logical function") ); break; } } @@ -1172,9 +1172,15 @@ void wxWindowDC::SetUpDC() m_brush = wxNullBrush; SetBrush( tmp_brush ); +/* tmp_brush = m_backgroundBrush; m_backgroundBrush = wxNullBrush; SetBackground( tmp_brush ); +*/ + tmp_brush = m_backgroundBrush; + m_backgroundBrush = wxNullBrush; + SetBackground( *wxWHITE_BRUSH ); + m_backgroundBrush = tmp_brush; if (!hatch_bitmap) { @@ -1200,6 +1206,26 @@ void wxWindowDC::Destroy() m_bgGC = (GdkGC*) NULL; } +void wxWindowDC::ComputeScaleAndOrigin() +{ + /* CMB: copy scale to see if it changes */ + double origScaleX = m_scaleX; + double origScaleY = m_scaleY; + + wxDC::ComputeScaleAndOrigin(); + + /* CMB: if scale has changed call SetPen to recalulate the line width */ + if ((m_scaleX != origScaleX || m_scaleY != origScaleY) && + (m_pen.Ok())) + { + /* this is a bit artificial, but we need to force wxDC to think + the pen has changed */ + wxPen pen = m_pen; + m_pen = wxNullPen; + SetPen( pen ); + } +} + // Resolution in pixels per logical inch wxSize wxWindowDC::GetPPI() const {