Skip to content

Commit

Permalink
Merge 58474d1 into 0b65d07
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyu139 committed Apr 24, 2018
2 parents 0b65d07 + 58474d1 commit 8c95eff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Tests/test_imagefont.py
Expand Up @@ -230,7 +230,10 @@ def test_multiline_size(self):
# Test that textsize() correctly connects to multiline_textsize()
self.assertEqual(draw.textsize(TEST_TEXT, font=ttf),
draw.multiline_textsize(TEST_TEXT, font=ttf))

# Test that multiline_textsize corresponds to ImageFont.textsize()
# for single line text
self.assertEqual(ttf.getsize('A'),
draw.multiline_textsize('A', font=ttf))
# Test that textsize() can pass on additional arguments
# to multiline_textsize()
draw.textsize(TEST_TEXT, font=ttf, spacing=4)
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/ImageDraw.py
Expand Up @@ -271,7 +271,7 @@ def multiline_textsize(self, text, font=None, spacing=4, direction=None,
line_width, line_height = self.textsize(line, font, spacing,
direction, features)
max_width = max(max_width, line_width)
return max_width, len(lines)*line_spacing
return max_width, len(lines)*line_spacing - spacing


def Draw(im, mode=None):
Expand Down

0 comments on commit 8c95eff

Please sign in to comment.