| 491 | | start = (min(self.selection_start[0], self.selection_end[0]), |
| 492 | | min(self.selection_start[1], self.selection_end[1])) |
| 493 | | end = (max(self.selection_start[0], self.selection_end[0]), |
| 494 | | max(self.selection_start[1], self.selection_end[1])) |
| | 491 | try: |
| | 492 | start = (min(self.selection_start[0], self.selection_end[0]), |
| | 493 | min(self.selection_start[1], self.selection_end[1])) |
| | 494 | end = (max(self.selection_start[0], self.selection_end[0]), |
| | 495 | max(self.selection_start[1], self.selection_end[1])) |
| | 496 | except TypeError: |
| | 497 | # There is no selection. |
| | 498 | return |
| 511 | | start = (min(self.selection_start[0], self.selection_end[0]), |
| 512 | | min(self.selection_start[1], self.selection_end[1])) |
| 513 | | end = (max(self.selection_start[0], self.selection_end[0]), |
| 514 | | max(self.selection_start[1], self.selection_end[1])) |
| | 515 | try: |
| | 516 | start = (min(self.selection_start[0], self.selection_end[0]), |
| | 517 | min(self.selection_start[1], self.selection_end[1])) |
| | 518 | end = (max(self.selection_start[0], self.selection_end[0]), |
| | 519 | max(self.selection_start[1], self.selection_end[1])) |
| | 520 | except TypeError: |
| | 521 | # There is no selection. |
| | 522 | return |
| 650 | | menu.append(make_menu_item("Create pattern from selection", "", self.on_popup_create_pattern)) |
| 651 | | menu.append(make_menu_item("Merge selected patterns", "", self.on_popup_merge)) |
| | 658 | m = make_menu_item("Create pattern from selection", "", self.on_popup_create_pattern) |
| | 659 | if self.selection_start == None: |
| | 660 | m.set_sensitive(False) |
| | 661 | menu.append(m) |
| | 662 | m = make_menu_item("Merge selected patterns", "", self.on_popup_merge) |
| | 663 | if self.selection_start == None: |
| | 664 | m.set_sensitive(False) |
| | 665 | menu.append(m) |