Skip to content

Commit 57872ef

Browse files
author
Steve Chaplin
committed
'SC'
svn path=/trunk/matplotlib/; revision=1729
1 parent 3490361 commit 57872ef

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/matplotlib/backends/backend_cairo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def __init__(self, dpi):
9696

9797
def set_ctx_from_surface (self, surface):
9898
self.ctx = cairo.Context (surface)
99+
self.ctx.save() # restore, save - when call new_gc()
99100

100101

101102
def set_width_height(self, width, height):
@@ -408,6 +409,8 @@ def get_text_width_height(self, s, prop, ismath):
408409

409410
def new_gc(self):
410411
if _debug: print '%s.%s()' % (self.__class__.__name__, _fn_name())
412+
self.ctx.restore() # matches save() in set_ctx_from_surface()
413+
self.ctx.save()
411414
return GraphicsContextCairo (renderer=self)
412415

413416

lib/matplotlib/backends/backend_gtkcairo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def set_pixmap (self, pixmap):
3333
self.ctx = pixmap.cairo_create()
3434
else:
3535
self.ctx = cairo.gtk.gdk_cairo_create (pixmap)
36+
self.ctx.save() # restore, save - when call new_gc()
3637

3738

3839
class FigureCanvasGTKCairo(FigureCanvasGTK):

0 commit comments

Comments
 (0)