Mercurial > nagslang
changeset 405:c0ce236f153c
Pad multiline text.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 07 Sep 2013 10:42:37 +0200 |
parents | 85d4c97ddac2 |
children | 7fcde01ea50e |
files | nagslang/widgets/text.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/nagslang/widgets/text.py Sat Sep 07 10:39:01 2013 +0200 +++ b/nagslang/widgets/text.py Sat Sep 07 10:42:37 2013 +0200 @@ -68,12 +68,14 @@ width = max(width, surface.get_rect().width) height += surface.get_rect().height surfaces.append(surface) + width += 2 * self.padding + height += 2 * self.padding self.surface = pygame.surface.Surface((width, height), pygame.locals.SRCALPHA) self.surface.fill(self.bg_colour) y = 0 for surface in surfaces: - self.surface.blit(surface, (0, y)) + self.surface.blit(surface, (self.padding, y + self.padding)) y += surface.get_rect().height self.text_rect = self.surface.get_rect() if not self.size: