PEP8 fixes.
[naja.git] / naja / widgets / text.py
index 6862b968907ec7132a15bc1a01f509e63d446e45..1d9732e4ced817da97dbdb9207107a59c84394cb 100644 (file)
@@ -226,6 +226,9 @@ class TextBoxWidget(TextWidget):
 
         x, y = self.padding, self.padding
         for line_surface in rendered_lines:
+            if self.centre:
+                x = (width - line_surface.get_rect().width) / 2
+                x += self.padding
             self.surface.blit(line_surface, (x, y))
             y += line_surface.get_rect().height
         for pos, img in image_map.items():