Revision: 7969
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7969&view=rev
Author:   mdehoon
Date:     2009-11-15 14:17:14 +0000 (Sun, 15 Nov 2009)

Log Message:
-----------
Bracket each call to new_gc() by a corresponding call to gc.restore() to avoid
bugs in the Cairo and Mac OS X backends.

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/patheffects.py
    trunk/matplotlib/lib/matplotlib/text.py

Modified: trunk/matplotlib/lib/matplotlib/patheffects.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patheffects.py      2009-11-15 14:07:11 UTC 
(rev 7968)
+++ trunk/matplotlib/lib/matplotlib/patheffects.py      2009-11-15 14:17:14 UTC 
(rev 7969)
@@ -119,6 +119,7 @@
 
         gc0 = self._update_gc(gc0, self._gc)
         renderer.draw_path(gc0, tpath, affine, None)
+        gc0.restore()
 
 
 class withStroke(Stroke):
@@ -183,6 +184,7 @@
 
         gc0 = self._update_gc(gc0, self._gc)
         renderer.draw_path(gc0, tpath, affine0, shadow_rgbFace)
+        gc0.restore()
 
 
 class withSimplePatchShadow(SimplePatchShadow):
@@ -198,6 +200,7 @@
         gc1.copy_properties(gc)
         gc1.set_alpha(gc1.get_alpha()*self._patch_alpha)
         renderer.draw_path(gc1, tpath, affine, rgbFace)
+        gc1.restore()
 
 
 if __name__ == '__main__':

Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py     2009-11-15 14:07:11 UTC (rev 
7968)
+++ trunk/matplotlib/lib/matplotlib/text.py     2009-11-15 14:17:14 UTC (rev 
7969)
@@ -590,6 +590,7 @@
                 else:
                     renderer.draw_tex(gc, x, y, clean_line,
                                       self._fontproperties, angle)
+            gc.restore()
             renderer.close_group('text')
             return
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to