10000 cairo: save a pair of ctx.save/ctx.restore. · matplotlib/matplotlib@b549d12 · GitHub
[go: up one dir, main page]

Skip to content

Commit b549d12

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 3edc982 commit b549d12

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

301301
fontProp = ttfFontProperty(font)
302-
ctx.save()
303302
ctx.select_font_face(fontProp.name,
304303
self.fontangles[fontProp.style],
305304
self.fontweights[fontProp.weight])
@@ -309,7 +308,6 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle):
309308
if not six.PY3 and isinstance(s, six.text_type):
310309
s = s.encode("utf-8")
311310
ctx.show_text(s)
312-
ctx.restore()
313311

314312
for ox, oy, w, h in rects:
315313
ctx.new_path()

0 commit comments

Comments
 (0)
0