X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98d8a7ece55ff5f8ca9cd39eba045d92df413fe6..11866e8e33b2034ba70102940177a3f9b460e4a1:/src/gtk/dcclient.cpp diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 1c3227b106..7c647971b0 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -28,6 +28,7 @@ #include "wx/fontutil.h" #include "wx/gtk/private.h" +#include "wx/gtk/private/object.h" #include @@ -954,6 +955,14 @@ void wxWindowDCImpl::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord bool originChanged; DrawingSetup(gc, originChanged); + // If the pen is transparent pen we increase the size + // for better compatibility with other platforms. + if (m_pen.GetStyle() == wxPENSTYLE_TRANSPARENT) + { + ++ww; + ++hh; + } + gdk_draw_arc(m_gdkwindow, gc, true, xx, yy, ww, hh, 0, 360*64); if (originChanged) @@ -961,7 +970,7 @@ void wxWindowDCImpl::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord } if (m_pen.GetStyle() != wxPENSTYLE_TRANSPARENT) - gdk_draw_arc( m_gdkwindow, m_penGC, FALSE, xx, yy, ww, hh, 0, 360*64 ); + gdk_draw_arc( m_gdkwindow, m_penGC, false, xx, yy, ww, hh, 0, 360*64 ); } CalcBoundingBox( x, y ); @@ -1000,18 +1009,15 @@ void wxWindowDCImpl::DoDrawMonoBitmap(const wxBitmap& bitmap, int xdest, int ydest, int width, int height) { - GdkPixmap *bitmap2 - = gdk_pixmap_new( wxGetRootWindow()->window, bmp_w, bmp_h, -1 ); - GdkGC *gc = gdk_gc_new( bitmap2 ); + wxGtkObject + bitmap2(gdk_pixmap_new( wxGetRootWindow()->window, bmp_w, bmp_h, -1 )); + wxGtkObject gc(gdk_gc_new( bitmap2 )); gdk_gc_set_foreground( gc, m_textForegroundColour.GetColor() ); gdk_gc_set_background( gc, m_textBackgroundColour.GetColor() ); gdk_wx_draw_bitmap(bitmap2, gc, bitmap.GetPixmap(), 0, 0); gdk_draw_drawable(m_gdkwindow, m_textGC, bitmap2, xsrc, ysrc, xdest, ydest, width, height); - - g_object_unref (bitmap2); - g_object_unref (gc); } // Returns a new mask that is the intersection of the old mask @@ -1026,7 +1032,7 @@ GdkBitmap* wxWindowDCImpl::GetClippedMask(GdkBitmap* mask, int w, int h, GdkColor c0, c1; c0.pixel = 0; c1.pixel = 1; - GdkGC *gc = gdk_gc_new( new_mask ); + wxGtkObject gc(gdk_gc_new( new_mask )); // zero-ing new_mask gdk_gc_set_foreground( gc, &c0 ); @@ -1044,7 +1050,6 @@ GdkBitmap* wxWindowDCImpl::GetClippedMask(GdkBitmap* mask, int w, int h, gdk_gc_set_stipple( gc, mask ); gdk_draw_rectangle( new_mask, gc, TRUE, 0, 0, w, h ); - g_object_unref (gc); return new_mask; }