From bb613e1dfe78ddf69aa23f8c56ecfc2b0cb625c5 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 17 May 2014 01:38:38 +0200 Subject: [PATCH] Fix TextBoxWidget centering to work with TextWidget centering. --- naja/widgets/text.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/naja/widgets/text.py b/naja/widgets/text.py index 587cb3c..1d9732e 100644 --- a/naja/widgets/text.py +++ b/naja/widgets/text.py @@ -132,7 +132,6 @@ class TextBoxWidget(TextWidget): self.border_colour = convert_colour(kwargs.pop('border_colour', PALETTE.BLACK)) self.box_width = kwargs.pop('box_width', 0) - self.centre = kwargs.pop('centre', False) super(TextBoxWidget, self).__init__(*args, **kwargs) @@ -227,10 +226,9 @@ class TextBoxWidget(TextWidget): x, y = self.padding, self.padding for line_surface in rendered_lines: - if self.centre and self.box_width: + if self.centre: x = (width - line_surface.get_rect().width) / 2 x += self.padding - print x, width, line_surface.get_rect().width self.surface.blit(line_surface, (x, y)) y += line_surface.get_rect().height for pos, img in image_map.items(): -- 2.34.1