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

Skip to content

Commit 14d7893

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 2a28e01 commit 14d7893

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
@@ -282,7 +282,6 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle):
282282
ctx.move_to(ox, oy)
283283

284284
fontProp = ttfFontProperty(font)
285-
ctx.save()
286285
ctx.select_font_face(fontProp.name,
287286
self.fontangles[fontProp.style],
288287
self.fontweights[fontProp.weight])
@@ -292,7 +291,6 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle):
292291
if not six.PY3 and isinstance(s, six.text_type):
293292
s = s.encode("utf-8")
294293
ctx.show_text(s)
295-
ctx.restore()
296294

297295
for ox, oy, w, h in rects:
298296
ctx.new_path()

0 commit comments

Comments
 (0)