# HG changeset patch # User Neil Muller # Date 1378137426 -7200 # Node ID 2e1059b1a2477e3322b77a18d277d7d55e33563d # Parent 79e1888573d374e262985655d734d45d9569824b Tweak button creation code diff -r 79e1888573d3 -r 2e1059b1a247 tools/area_editor.py --- 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)