Skip to content

Commit 89d0d3b

Browse files
committed
TeX-ify the alignment even more (and break images again)
1 parent b15a1c1 commit 89d0d3b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,18 +2762,21 @@ def _genfrac(self, ldelim, rdelim, rule, style, num, den):
27622762
cap_height = state.font_output.get_metrics(
27632763
state.font, mpl.rcParams['mathtext.default'],
27642764
'H', state.fontsize, state.dpi).height
2765-
thickness = state.font_output.get_underline_thickness(
2766-
state.font, state.fontsize, state.dpi)
27672765

27682766
rule = float(rule)
2767+
if rule:
2768+
thickness = rule
2769+
else:
2770+
thickness = state.font_output.get_underline_thickness(
2771+
state.font, state.fontsize, state.dpi)
27692772

27702773
if style is not self._MathStyle.DISPLAYSTYLE:
27712774
num.shrink()
27722775
den.shrink()
2773-
min_clearance = np.ceil(0.5 * thickness)
2774-
cap_height *= 0.7
2776+
cap_height *= SHRINK_FACTOR
2777+
min_clearance = thickness if rule else 1.5 * thickness
27752778
else:
2776-
min_clearance = 1.5 * thickness
2779+
min_clearance = 3 * thickness if rule else 3.5 * thickness
27772780
cnum = HCentered([num])
27782781
cden = HCentered([den])
27792782
width = max(num.width, den.width)

0 commit comments

Comments
 (0)