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

Skip to content

Commit 222021b

Browse files
committed
Keep depth positive when calculating mathtext bounding box
1 parent adf4666 commit 222021b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/mathtext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def _update_bbox(self, x1, y1, x2, y2):
178178
def set_canvas_size(self, w, h, d):
179179
MathtextBackend.set_canvas_size(self, w, h, d)
180180
if self.mode != 'bbox':
181-
self.image = FT2Image(ceil(w), ceil(h + d))
181+
self.image = FT2Image(ceil(w), ceil(h + max(d, 0)))
182182

183183
def render_glyph(self, ox, oy, info):
184184
if self.mode == 'bbox':

0 commit comments

Comments
 (0)