Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77af0f7

Browse files
committed
cairo: save a pair of ctx.save/ctx.restore.
The removed pair of ctx.save and ctx.restore was clearly unnecessary (the outer one is still there, and the font is reset at each loop iteration).
1 parent 9e1f209 commit 77af0f7

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/matplotlib/backends/backend_cairo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle):
301301
ctx.move_to(ox, oy)
302302

303303
fontProp = ttfFontProperty(font)
304-
ctx.save()
305304
ctx.select_font_face (fontProp.name,
306305
self.fontangles [fontProp.style],
307306
self.fontweights[fontProp.weight])
@@ -311,7 +310,6 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle):
311310
if not six.PY3 and isinstance(s, six.text_type):
312311
s = s.encode("utf-8")
313312
ctx.show_text(s)
314-
ctx.restore()
315313

316314
for ox, oy, w, h in rects:
317315
ctx.new_path()

0 commit comments

Comments
 (0)