Skip to content

Commit d5b253e

Browse files
committed
Update raster w, h, d calculation
1 parent 0a6beed commit d5b253e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/matplotlib/_mathtext.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ def to_raster(self, antialiased=None):
117117
*[x2 for x1, y1, x2, y2 in self.rects], 0]) + 1
118118
ymax = max([*[oy - info.metrics.ymin for ox, oy, info in self.glyphs],
119119
*[y2 for x1, y1, x2, y2 in self.rects], 0]) + 1
120-
w = xmax - xmin
121-
h = ymax - ymin - self.box.depth
122-
d = ymax - ymin - self.box.height
120+
w, h, d = map(
121+
np.ceil, [self.box.width, self.box.height, self.box.depth])
123122
image = FT2Image(np.ceil(w), np.ceil(h + max(d, 0)))
124123

125124
# Ideally, we could just use self.glyphs and self.rects here, shifting

0 commit comments

Comments
 (0)