Changeset 411:ddff1f8668d5


Ignore:
Timestamp:
Sep 7, 2013, 10:38:51 AM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
rebase_source:
1ed9f2c09a71d78e5858684ed5fd6b605125beac
Message:

Unbreak polygon drawing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/area_editor.py

    r407 r411  
    182182                             mouse_pos for p in pointlist]
    183183                pygame.draw.lines(self._surface, color, False, pointlist, 2)
    184             elif len(polygon) > 1:
     184                break
     185            if len(polygon) > 1:
    185186                pointlist = [self.point_to_pygame(p) for p in polygon]
    186187                pygame.draw.lines(self._surface, color, False, pointlist, 2)
    187             elif index == mouse_poly and mouse_pos:
     188            if index == mouse_poly and mouse_pos:
    188189                endpoint = self.fix_poly_angle(index, mouse_pos)
    189190                pygame.draw.line(self._surface, color,
     
    594595                # find the current point
    595596                self._move_point = self.level.find_vertex(corrected_pos)
     597        elif self.cur_poly and ev.button == 1:
     598            # Add a point
     599            self.level.add_point(self.cur_poly,
     600                                 self._level_coordinates(corrected_pos))
    596601        elif ev.button == 1:
    597602            if self._draw_lines:
     
    613618        elif ev.button == 7:  # Scroll right
    614619            self._move_view((10, 0))
    615         elif self.cur_poly and ev.button == 1:
    616             # Add a point
    617             self.level.add_point(self.cur_poly,
    618                                  self._level_coordinates(ev.pos))
    619620        elif ev.button == 3:
    620621            self._mouse_drag = True
Note: See TracChangeset for help on using the changeset viewer.