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(
300
300
301
301
y_offset_tight = self ._ascent // 2
302
302
303
- newline = False
303
+ newlines = 0
304
304
line_spacing = self ._line_spacing
305
305
306
306
for char in text :
307
307
308
308
if char == "\n " : # newline
309
- newline = True
309
+ newlines += 1
310
310
311
311
else :
312
312
@@ -315,13 +315,13 @@ def _text_bounding_box(
315
315
if my_glyph is None : # Error checking: no glyph found
316
316
print ("Glyph not found: {}" .format (repr (char )))
317
317
else :
318
- if newline :
319
- newline = False
318
+ if newlines :
320
319
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
325
325
if xposition == x_start :
326
326
if left is None :
327
327
left = 0
You can’t perform that action at this time.
0 commit comments