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

Skip to content

Commit 577da78

Browse files
committed
Sync Cairo's usetex measurement with base class.
1 parent d85adce commit 577da78

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/matplotlib/backends/backend_cairo.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,12 @@ def get_canvas_width_height(self):
286286
def get_text_width_height_descent(self, s, prop, ismath):
287287
# docstring inherited
288288

289+
if ismath == 'TeX':
290+
return super().get_text_width_height_descent(s, prop, ismath)
291+
289292
if ismath:
290-
width, height, descent, fonts, used_characters = \
291-
self.mathtext_parser.parse(s, self.dpi, prop)
292-
return width, height, descent
293+
dims = self.mathtext_parser.parse(s, self.dpi, prop)
294+
return dims[0:3] # return width, height, descent
293295

294296
ctx = self.text_ctx
295297
# problem - scale remembers last setting and font can become

0 commit comments

Comments
 (0)