changeset 134:2e1059b1a247

Tweak button creation code
author Neil Muller <drnlmuller@gmail.com>
date Mon, 02 Sep 2013 17:57:06 +0200
parents 79e1888573d3
children c9b6685ebebf
files tools/area_editor.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/tools/area_editor.py	Mon Sep 02 18:05:03 2013 +0200
+++ b/tools/area_editor.py	Mon Sep 02 17:57:06 2013 +0200
@@ -228,27 +228,28 @@
                 y += MENU_BUTTON_HEIGHT + MENU_PAD
             self.add(but)
 
+        button_rect = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT)
+
         end_poly_but = PolyButton(None, self.level_widget)
-        end_poly_but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH,
-                                             MENU_BUTTON_HEIGHT)
+        end_poly_but.rect = button_rect.copy()
         end_poly_but.rect.move_ip(MENU_LEFT, y)
         self.add(end_poly_but)
         y += MENU_BUTTON_HEIGHT + MENU_PAD
 
         fill_but = Button('Fill exterior', action=self.level_widget.set_filled)
-        fill_but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT)
+        fill_but.rect = button_rect.copy()
         fill_but.rect.move_ip(MENU_LEFT, y)
         self.add(fill_but)
         y += MENU_BUTTON_HEIGHT + MENU_PAD
 
         save_but = Button('Save Level', action=self.save)
-        save_but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT)
+        save_but.rect = button_rect.copy()
         save_but.rect.move_ip(MENU_LEFT, y)
         self.add(save_but)
         y += MENU_BUTTON_HEIGHT + MENU_PAD
 
         quit_but = Button('Quit', action=self.quit)
-        quit_but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT)
+        quit_but.rect = button_rect.copy()
         quit_but.rect.move_ip(MENU_LEFT, y)
         self.add(quit_but)