]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't change the current pen and brush in DrawHeaderButtonContents().
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 15 May 2010 11:15:05 +0000 (11:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 15 May 2010 11:15:05 +0000 (11:15 +0000)
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

src/generic/renderg.cpp

index baf845cb63a521d7f1177f07fdb16d9a55c9f6ef..5f293f94239ae84c27d612f89ab5c924530c2715 100644 (file)
@@ -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;