]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxDCPenChanger instead of setting/resetting pen explicitly.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 15 Oct 2010 23:46:37 +0000 (23:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 15 Oct 2010 23:46:37 +0000 (23:46 +0000)
No real changes, just use wxDCPenChanger instead of manual calls to SetPen()
in wxDCImpl::DrawPolygon(). This makes the code shorter and more clear.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65819 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/dcbase.cpp

index 807c0cae30cfd062ead10c1698a73ac383546c68..d65b47e3e6a20af617f6c6acfa9bb464b8046137 100644 (file)
@@ -730,7 +730,6 @@ wxDCImpl::DoDrawPolyPolygon(int n,
 
     int      i, j, lastOfs;
     wxPoint* pts;
-    wxPen    pen;
 
     for (i = j = lastOfs = 0; i < n; i++)
     {
@@ -746,10 +745,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);