X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cd25b18c8e7e8d77b1a5847f289afec6e114fbd5..18027d49b9daea9f8808052d927246b4489b0ef9:/src/gtk1/dcclient.cpp?ds=sidebyside diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 0df1276c4b..81bd578de4 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -304,6 +304,7 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse long x2 = XLOG2DEV(points[i+1].x + xoffset); long y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste long y2 = YLOG2DEV(points[i+1].y + yoffset); + if (m_window) gdk_draw_line( m_window, m_penGC, x1, y1, x2, y2 ); @@ -327,7 +328,7 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoff CalcBoundingBox( points[i].x + xoffset, points[i].y + yoffset ); } - if (m_brush.GetStyle() != wxTRANSPARENT) + if ((m_brush.GetStyle() != wxTRANSPARENT) && m_window) gdk_draw_polygon (m_window, m_brushGC, TRUE, gdkpoints, n); // To do: Fillstyle @@ -995,28 +996,25 @@ void wxWindowDC::SetBrush( const wxBrush &brush ) m_brush.GetColour().CalcPixel( m_cmap ); gdk_gc_set_foreground( m_brushGC, m_brush.GetColour().GetColor() ); - GdkFill fillStyle = GDK_SOLID; - switch (m_brush.GetStyle()) - { - case wxSOLID: - case wxTRANSPARENT: - break; - default: - fillStyle = GDK_STIPPLED; - } - - gdk_gc_set_fill( m_brushGC, fillStyle ); + gdk_gc_set_fill( m_brushGC, GDK_SOLID ); if ((m_brush.GetStyle() == wxSTIPPLE) && (m_brush.GetStipple()->Ok())) { if (m_brush.GetStipple()->GetPixmap()) + { + gdk_gc_set_fill( m_brushGC, GDK_TILED ); gdk_gc_set_tile( m_brushGC, m_brush.GetStipple()->GetPixmap() ); + } else + { + gdk_gc_set_fill( m_brushGC, GDK_STIPPLED ); gdk_gc_set_stipple( m_brushGC, m_brush.GetStipple()->GetBitmap() ); + } } if (IS_HATCH(m_brush.GetStyle())) { + gdk_gc_set_fill( m_brushGC, GDK_STIPPLED ); int num = m_brush.GetStyle() - wxBDIAGONAL_HATCH; gdk_gc_set_stipple( m_brushGC, hatches[num] ); } @@ -1042,29 +1040,26 @@ void wxWindowDC::SetBackground( const wxBrush &brush ) gdk_gc_set_background( m_penGC, m_backgroundBrush.GetColour().GetColor() ); gdk_gc_set_background( m_bgGC, m_backgroundBrush.GetColour().GetColor() ); gdk_gc_set_foreground( m_bgGC, m_backgroundBrush.GetColour().GetColor() ); - - GdkFill fillStyle = GDK_SOLID; - switch (m_backgroundBrush.GetStyle()) - { - case wxSOLID: - case wxTRANSPARENT: - break; - default: - fillStyle = GDK_STIPPLED; - } - - gdk_gc_set_fill( m_bgGC, fillStyle ); + + gdk_gc_set_fill( m_bgGC, GDK_SOLID ); if ((m_backgroundBrush.GetStyle() == wxSTIPPLE) && (m_backgroundBrush.GetStipple()->Ok())) { - if (m_brush.GetStipple()->GetPixmap()) - gdk_gc_set_tile( m_bgGC, m_brush.GetStipple()->GetPixmap() ); + if (m_backgroundBrush.GetStipple()->GetPixmap()) + { + gdk_gc_set_fill( m_bgGC, GDK_TILED ); + gdk_gc_set_tile( m_bgGC, m_backgroundBrush.GetStipple()->GetPixmap() ); + } else - gdk_gc_set_stipple( m_bgGC, m_brush.GetStipple()->GetBitmap() ); + { + gdk_gc_set_fill( m_bgGC, GDK_STIPPLED ); + gdk_gc_set_stipple( m_bgGC, m_backgroundBrush.GetStipple()->GetBitmap() ); + } } if (IS_HATCH(m_backgroundBrush.GetStyle())) { + gdk_gc_set_fill( m_bgGC, GDK_STIPPLED ); int num = m_backgroundBrush.GetStyle() - wxBDIAGONAL_HATCH; gdk_gc_set_stipple( m_bgGC, hatches[num] ); }