Changeset 436:7079c3214d72


Ignore:
Timestamp:
09/07/13 12:19:31 (8 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Message:

Scale lines when we zoom out

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/area_editor.py

    r435 r436  
    116116
    117117    def draw(self, mouse_pos, mouse_poly, filled, draw_cand_line, start_pos,
    118              move_point_mode, move_point):
     118             move_point_mode, move_point, zoom_factor):
    119119        self._draw_background(True)
    120120        # Draw polygons as needed for the editor
     121        line_width = int(2 * zoom_factor)
    121122        if filled:
    122123            self._draw_exterior(True)
     
    127128                pointlist = [self.point_to_pygame(p) if p != move_point else
    128129                             mouse_pos for p in pointlist]
    129                 pygame.draw.lines(self._surface, color, False, pointlist, 2)
     130                pygame.draw.lines(self._surface, color, False, pointlist,
     131                                  line_width)
    130132                break
    131133            if len(polygon) > 1:
    132134                pointlist = [self.point_to_pygame(p) for p in polygon]
    133                 pygame.draw.lines(self._surface, color, False, pointlist, 2)
     135                pygame.draw.lines(self._surface, color, False, pointlist,
     136                                  line_width)
    134137            if index == mouse_poly and mouse_pos:
    135138                endpoint = self.point_to_pymunk(mouse_pos)
     
    145148                    pointlist.remove(self.point_to_pygame(move_point))
    146149                    pointlist.append(mouse_pos)
    147             pygame.draw.lines(self._surface, LINE_COLOR, False, pointlist, 2)
     150            pygame.draw.lines(self._surface, LINE_COLOR, False, pointlist,
     151                              line_width)
    148152        if draw_cand_line and start_pos and mouse_pos:
    149153            endpoint = self.snap_to_grid(mouse_pos)
     
    472476        level_surface = level.draw(mouse_pos, self.cur_poly, self.filled_mode,
    473477                                   self._draw_lines, self._start_pos,
    474                                    self._move_point_mode, self._move_point)
     478                                   self._move_point_mode, self._move_point,
     479                                   self._zoom_factor)
    475480        if self._draw_objects:
    476481            for thing in self.level.drawables:
Note: See TracChangeset for help on using the changeset viewer.