]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcbase.cpp
Compilation fix: don't use "environ" under OS X.
[wxWidgets.git] / src / common / dcbase.cpp
index 807c0cae30cfd062ead10c1698a73ac383546c68..5cad40cfeed5ae89617577eb7970cf983daf6134 100644 (file)
@@ -236,6 +236,12 @@ wxMemoryDC::wxMemoryDC(wxDC *dc)
 
 void wxMemoryDC::SelectObject(wxBitmap& bmp)
 {
+    if ( bmp.IsSameAs(GetSelectedBitmap()) )
+    {
+        // Nothing to do, this bitmap is already selected.
+        return;
+    }
+
     // make sure that the given wxBitmap is not sharing its data with other
     // wxBitmap instances as its contents will be modified by any drawing
     // operation done on this DC
@@ -730,7 +736,6 @@ wxDCImpl::DoDrawPolyPolygon(int n,
 
     int      i, j, lastOfs;
     wxPoint* pts;
-    wxPen    pen;
 
     for (i = j = lastOfs = 0; i < n; i++)
     {
@@ -746,10 +751,11 @@ wxDCImpl::DoDrawPolyPolygon(int n,
         pts[j++] = pts[lastOfs];
     }
 
-    pen = GetPen();
-    SetPen(wxPen(*wxBLACK, 0, wxPENSTYLE_TRANSPARENT));
-    DoDrawPolygon(j, pts, xoffset, yoffset, fillStyle);
-    SetPen(pen);
+    {
+        wxDCPenChanger setTransp(*m_owner, *wxTRANSPARENT_PEN);
+        DoDrawPolygon(j, pts, xoffset, yoffset, fillStyle);
+    }
+
     for (i = j = 0; i < n; i++)
     {
         DoDrawLines(count[i], pts+j, xoffset, yoffset);