Merge pull request #6515 from misl6/fix-max_lines-valign

Fixes positioning (valign) issue when using max_lines
This commit is contained in:
matham 2019-09-14 11:30:52 -04:00 committed by GitHub
commit 5cdd52a6a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -566,8 +566,10 @@ def layout_text(object text, list lines, tuple size, tuple text_size,
if max_lines > 0 and len(lines) > max_lines:
val = True
if dwn:
h-= sum(l.h for l in lines[max_lines:])
del lines[max_lines:]
else:
h-= sum(l.h for l in lines[:max(0, <int>len(lines) - max_lines)])
del lines[:max(0, <int>len(lines) - max_lines)]
# now make sure we don't have lines outside specified height