Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8ff6e8a

Browse filesBrowse files
authored
Merge pull request #19314 from aitikgupta/overunder-alignment
Fix over/under mathtext symbols
2 parents 6290958 + b74db71 commit 8ff6e8a
Copy full SHA for 8ff6e8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

41 files changed

+7459
-4169
lines changed

‎lib/matplotlib/_mathtext.py

Copy file name to clipboardExpand all lines: lib/matplotlib/_mathtext.py
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2674,7 +2674,7 @@ def subsuper(self, s, loc, toks):
26742674
super.kern()
26752675
super.hpack()
26762676

2677-
# Handle over/under symbols, such as sum or integral
2677+
# Handle over/under symbols, such as sum or prod
26782678
if self.is_overunder(nucleus):
26792679
vlist = []
26802680
shift = 0.
@@ -2686,18 +2686,19 @@ def subsuper(self, s, loc, toks):
26862686
sub.shrink()
26872687
width = max(width, sub.width)
26882688

2689+
vgap = rule_thickness * 3.0
26892690
if super is not None:
26902691
hlist = HCentered([super])
26912692
hlist.hpack(width, 'exactly')
2692-
vlist.extend([hlist, Kern(rule_thickness * 3.0)])
2693+
vlist.extend([hlist, Vbox(0, vgap)])
26932694
hlist = HCentered([nucleus])
26942695
hlist.hpack(width, 'exactly')
26952696
vlist.append(hlist)
26962697
if sub is not None:
26972698
hlist = HCentered([sub])
26982699
hlist.hpack(width, 'exactly')
2699-
vlist.extend([Kern(rule_thickness * 3.0), hlist])
2700-
shift = hlist.height
2700+
vlist.extend([Vbox(0, vgap), hlist])
2701+
shift = hlist.height + vgap
27012702
vlist = Vlist(vlist)
27022703
vlist.shift_amount = shift + nucleus.depth
27032704
result = Hlist([vlist])
Binary file not shown.
Loading

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.