From 7693f9bf9c24ed9d92aee0ddc80069b7e82c4a72 Mon Sep 17 00:00:00 2001 From: Balthasar Reuter Date: Sun, 28 Jun 2015 19:04:24 +0200 Subject: [PATCH] Empty lines are now included --- gui.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/gui.py b/gui.py index f8cc6f4..f5fc5d8 100644 --- a/gui.py +++ b/gui.py @@ -144,18 +144,17 @@ class GUI_PyGame: # Blit one line after another accumulated_height = 0 for line in text: - if line != "": - tempsurface = font.render(line, 1, color) - if halign == 0: # left aligned - hoffset = 0 - elif halign == 1: # centered - hoffset = (self.size[0] - tempsurface.get_width()) / 2 - elif halign == 2: # right aligned - hoffset = rect.width - tempsurface.get_width() - else: - raise GuiException("Invalid halign argument: " + str(justification)) - surface.blit(tempsurface, (hoffset, voffset + accumulated_height)) - accumulated_height += font.size(line)[1] + tempsurface = font.render(line, 1, color) + if halign == 0: # left aligned + hoffset = 0 + elif halign == 1: # centered + hoffset = (self.size[0] - tempsurface.get_width()) / 2 + elif halign == 2: # right aligned + hoffset = rect.width - tempsurface.get_width() + else: + raise GuiException("Invalid halign argument: " + str(justification)) + surface.blit(tempsurface, (hoffset, voffset + accumulated_height)) + accumulated_height += font.size(line)[1] # Make background color transparent if transparency: