X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a56fcaaf46ccce9f6f79b8fad977dfe5a721ea61..f5ba273ecd799f652736ce2bc830283787302a56:/src/gtk/dcclient.cpp?ds=sidebyside diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index ee0bc00929..a99a0791e7 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1452,13 +1452,23 @@ void wxWindowDC::SetPen( const wxPen &pen ) { for (int i = 0; i < req_nb_dash; i++) real_req_dash[i] = req_dash[i] * width; - gdk_gc_set_dashes( m_penGC, 0, real_req_dash, req_nb_dash ); +#if GTK_CHECK_VERSION(1,2,7) + gdk_gc_set_dashes( m_penGC, 0, (gint8*) real_req_dash, + req_nb_dash ); +#else + gdk_gc_set_dashes( m_penGC, 0, real_req_dash, + req_nb_dash ); +#endif delete[] real_req_dash; } else { // No Memory. We use non-scaled dash pattern... +#if GTK_CHECK_VERSION(1,2,7) + gdk_gc_set_dashes( m_penGC, 0, (gint8*)req_dash, req_nb_dash ); +#else gdk_gc_set_dashes( m_penGC, 0, (char*)req_dash, req_nb_dash ); +#endif } } #endif @@ -1698,8 +1708,6 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoo { wxCHECK_RET( Ok(), wxT("invalid window dc") ); - wxDC::DoSetClippingRegion( x, y, width, height ); - if (!m_window) return; wxRect rect; @@ -1718,6 +1726,10 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoo m_currentClippingRegion.Intersect( m_paintClippingRegion ); #endif + wxCoord xx, yy, ww, hh; + m_currentClippingRegion.GetBox( xx, yy, ww, hh ); + wxDC::DoSetClippingRegion( xx, yy, ww, hh ); + gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() ); gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() ); gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() ); @@ -1734,11 +1746,6 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) return; } - wxCoord x,y,w,h; - region.GetBox( x, y, w, h ); - - wxDC::DoSetClippingRegion( x, y, w, h ); - if (!m_window) return; if (!m_currentClippingRegion.IsNull()) @@ -1751,6 +1758,10 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) m_currentClippingRegion.Intersect( m_paintClippingRegion ); #endif + wxCoord xx, yy, ww, hh; + m_currentClippingRegion.GetBox( xx, yy, ww, hh ); + wxDC::DoSetClippingRegion( xx, yy, ww, hh ); + gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() ); gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() ); gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() ); @@ -2017,7 +2028,10 @@ wxPaintDC::wxPaintDC() wxPaintDC::wxPaintDC( wxWindow *win ) : wxWindowDC( win ) { -#if USE_PAINT_REGION +#if USE_PAINT_REGION + if (!win->m_clipPaintRegion) + return; + m_paintClippingRegion = win->GetUpdateRegion(); m_currentClippingRegion.Union( m_paintClippingRegion );