File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -300,13 +300,13 @@ def _text_bounding_box(
300300
301301 y_offset_tight = self ._ascent // 2
302302
303- newline = False
303+ newlines = 0
304304 line_spacing = self ._line_spacing
305305
306306 for char in text :
307307
308308 if char == "\n " : # newline
309- newline = True
309+ newlines += 1
310310
311311 else :
312312
@@ -315,13 +315,13 @@ def _text_bounding_box(
315315 if my_glyph is None : # Error checking: no glyph found
316316 print ("Glyph not found: {}" .format (repr (char )))
317317 else :
318- if newline :
319- newline = False
318+ if newlines :
320319 xposition = x_start # reset to left column
321- yposition = yposition + self ._line_spacing_ypixels (
322- font , line_spacing
323- ) # Add a newline
324- lines += 1
320+ yposition += (
321+ self ._line_spacing_ypixels (font , line_spacing ) * newlines
322+ ) # Add the newline(s)
323+ lines += newlines
324+ newlines = 0
325325 if xposition == x_start :
326326 if left is None :
327327 left = 0
You can’t perform that action at this time.
0 commit comments