197 |
def RenderMap(self, map, region, selected_layer, selected_shape): |
def RenderMap(self, map, region, selected_layer, selected_shape): |
198 |
"""Render the map. |
"""Render the map. |
199 |
|
|
200 |
Only the given region (a wxRect in window coordinates) needs to |
Only the given region (a tuple in window coordinates as returned |
201 |
be redrawn. Highlight the shape with id selected_shape in the |
by a wxrect's asTuple method) needs to be redrawn. Highlight the |
202 |
selected_layer. |
shape with id selected_shape in the selected_layer. |
203 |
""" |
""" |
204 |
self.update_region = region |
self.update_region = region |
205 |
self.selected_layer = selected_layer |
self.selected_layer = selected_layer |
246 |
offx, offy = self.offset |
offx, offy = self.offset |
247 |
xs = [] |
xs = [] |
248 |
ys = [] |
ys = [] |
249 |
x, y, width, height = self.update_region.asTuple() |
x, y, width, height = self.update_region |
250 |
for winx, winy in ((x, y), (x + width, y), |
for winx, winy in ((x, y), (x + width, y), |
251 |
(x + width, y + height), (x, y + height)): |
(x + width, y + height), (x, y + height)): |
252 |
px = (winx - offx) / scale |
px = (winx - offx) / scale |