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 @@ -293,13 +293,13 @@ def _text_bounding_box(
293
293
294
294
y_offset_tight = self ._ascent // 2
295
295
296
- newline = False
296
+ newlines = 0
297
297
line_spacing = self ._line_spacing
298
298
299
299
for char in text :
300
300
301
301
if char == "\n " : # newline
302
- newline = True
302
+ newlines += 1
303
303
304
304
else :
305
305
@@ -308,13 +308,13 @@ def _text_bounding_box(
308
308
if my_glyph is None : # Error checking: no glyph found
309
309
print ("Glyph not found: {}" .format (repr (char )))
310
310
else :
311
- if newline :
312
- newline = False
311
+ if newlines :
313
312
xposition = x_start # reset to left column
314
- yposition = yposition + self ._line_spacing_ypixels (
315
- font , line_spacing
316
- ) # Add a newline
317
- lines += 1
313
+ yposition += (
314
+ self ._line_spacing_ypixels (font , line_spacing ) * newlines
315
+ ) # Add the newline(s)
316
+ lines += newlines
317
+ newlines = 0
318
318
if xposition == x_start :
319
319
if left is None :
320
320
left = 0
You can’t perform that action at this time.
0 commit comments