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

Skip to content

Commit 838502e

Browse files
committed
Merge pull request #5448 from zblz/fix-vlist-subsuper
Fix #5444: do not access subsuper nucleus _metrics if not available
2 parents d6354b8 + 4b10fdf commit 838502e

17 files changed

+894
-2
lines changed

lib/matplotlib/mathtext.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,10 +2859,12 @@ def subsuper(self, s, loc, toks):
28592859
new_children = nucleus.children
28602860
if len(new_children):
28612861
# remove last kern
2862-
if isinstance(new_children[-1],Kern):
2862+
if (isinstance(new_children[-1],Kern) and
2863+
hasattr(new_children[-2], '_metrics')):
28632864
new_children = new_children[:-1]
28642865
last_char = new_children[-1]
2865-
last_char.width = last_char._metrics.advance
2866+
if hasattr(last_char, '_metrics'):
2867+
last_char.width = last_char._metrics.advance
28662868
# create new Hlist without kerning
28672869
nucleus = Hlist(new_children, do_kern=False)
28682870
else:
Binary file not shown.
Lines changed: 236 additions & 0 deletions
Loading
Binary file not shown.
Lines changed: 134 additions & 0 deletions
Loading
Binary file not shown.

0 commit comments

Comments
 (0)