fix prepended space in word wrap
This commit is contained in:
parent
b9bdbc5787
commit
74cb3c7b1e
|
@ -256,13 +256,15 @@ def get_wrapped_text_surface(font, text, width, antialias=True, color=(0, 0, 0),
|
|||
lines.append(line)
|
||||
line_text = ""
|
||||
else:
|
||||
line_text += " " + words[ii]
|
||||
if ii > 0:
|
||||
line_text += " "
|
||||
line_text += words[ii]
|
||||
ii += 1
|
||||
font.set_italic(False)
|
||||
top = 0
|
||||
surface = Surface((width, height), pygame.SRCALPHA)
|
||||
if background:
|
||||
surface.fill(background)
|
||||
# if background:
|
||||
# surface.fill(background)
|
||||
rect = surface.get_rect()
|
||||
for line in lines:
|
||||
line_rect = line.get_rect()
|
||||
|
|
Loading…
Reference in New Issue