Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/mapnav.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-05-06 03:57:04 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-05-06 03:57:04 (GMT)
commitd5da0a7254936f96e9382730e48ca336bd3d7217 (patch)
treed4bab2b0f658157daf2bc302ab6a8d8e6797362b /mapnav.py
parenta5635666753a3ac266664c9dd85f812f50d81cff (diff)
Add save/restore context commands to isolate different drawings
No real change, is only to avoid future problems. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'mapnav.py')
-rw-r--r--mapnav.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mapnav.py b/mapnav.py
index 1f089d0..36627e9 100644
--- a/mapnav.py
+++ b/mapnav.py
@@ -382,7 +382,7 @@ class MapNavView(gtk.DrawingArea):
def draw(self, ctx, clip_x, clip_y, clip_width, clip_height):
def darken(color, factor=0.8):
return tuple(c * factor for c in color)
-
+ ctx.save()
x, y = self.x, self.y
info_walls = self.get_information_walls(x, y, self.direction)
# draw back wall
@@ -436,7 +436,7 @@ class MapNavView(gtk.DrawingArea):
ctx.fill_preserve()
ctx.set_source_rgb(*stroke)
ctx.stroke()
-
+ ctx.restore()
if info_walls['objects']:
for wall_object in info_walls['objects']:
image_file_name = wall_object['image_file_name']
@@ -486,7 +486,6 @@ class MapNavView(gtk.DrawingArea):
wall_object['width'] = width
wall_object['height'] = height
- ctx.restore()
if self.view_mode == self.MODE_EDIT and \
self.selected is not None and \
self.selected.data['original'] == wall_object['original']:
@@ -501,6 +500,7 @@ class MapNavView(gtk.DrawingArea):
wall_y - RESIZE_HANDLE_SIZE / 2,
RESIZE_HANDLE_SIZE, RESIZE_HANDLE_SIZE)
ctx.stroke()
+ ctx.restore()
def _get_door_x(self):
if self.direction in ('N', 'W'):