From: Vadim Zeitlin Date: Sat, 15 May 2010 11:15:05 +0000 (+0000) Subject: Don't change the current pen and brush in DrawHeaderButtonContents(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/78010a1f33c78f9ec6f17b2774a25ad71c5930fd Don't change the current pen and brush in DrawHeaderButtonContents(). Renderer methods shouldn't affect the functions drawing on the DC after it but the wxRendererGeneric implementation did. Use wxDC{Pen,Brush}Changer classes instead of calling wxDC::Set{Pen,Brush}() directly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/renderg.cpp b/src/generic/renderg.cpp index baf845cb63..5f293f9423 100644 --- a/src/generic/renderg.cpp +++ b/src/generic/renderg.cpp @@ -324,8 +324,10 @@ wxRendererGeneric::DrawHeaderButtonContents(wxWindow *win, wxColour c = (params && params->m_arrowColour.Ok()) ? params->m_arrowColour : wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW); - dc.SetPen(wxPen(c)); - dc.SetBrush(wxBrush(c)); + + wxDCPenChanger setPen(dc, c); + wxDCBrushChanger setBrush(dc, c); + dc.DrawPolygon( 3, triPt, ar.x, ar.y); } labelWidth += arrowSpace;