Skip to content

Commit b3ad40a

Browse files
mdboomQuLogic
authored andcommitted
Stabilize mathtext baseline
1 parent 4af11e7 commit b3ad40a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ def to_raster(self, *, antialiased: bool) -> RasterParse:
157157

158158
for ox, oy, info in shifted.glyphs:
159159
info.font.draw_glyph_to_bitmap(
160-
image, int(ox), int(oy - info.metrics.iceberg), info.glyph,
160+
image,
161+
int(ox),
162+
int(oy - np.ceil(info.metrics.iceberg)),
163+
info.glyph,
161164
antialiased=antialiased)
162165
for x1, y1, x2, y2 in shifted.rects:
163166
height = max(int(y2 - y1) - 1, 0)

0 commit comments

Comments
 (0)