From f8ce98ded08fd7e5960f4aadfcf7e923df79222b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Oct 2010 23:46:37 +0000 Subject: [PATCH] Use wxDCPenChanger instead of setting/resetting pen explicitly. 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index 807c0cae30..d65b47e3e6 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -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); -- 2.45.2