From 2b6c3b8307b016a13eb1bf7268fc0aaf5cafa9aa Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 27 Mar 2010 20:18:02 -0400 Subject: [PATCH] Configurable line color --- pyrisk/graphics.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pyrisk/graphics.py b/pyrisk/graphics.py index 6ca4aa2..f171e0d 100644 --- a/pyrisk/graphics.py +++ b/pyrisk/graphics.py @@ -331,13 +331,14 @@ class WorldRenderer (object): self.template_lib = TEMPLATE_LIBRARY self.buf = buf self.line_width = line_width + self.line_color = 'black' self.dpcm = dpcm def render(self, world): template = self.template_lib.get(world.name) if template == None: template = self._auto_template(world) - return self.render_template(template) - def render_template(self, template): + return self.render_template(world, template) + def render_template(self, world, template): region_pos,width,height = self._locate(template) lines = [ '', @@ -353,8 +354,8 @@ class WorldRenderer (object): for r in template.regions: lines.extend([ '' % r.name, - '' % ' '.join(['%d,%d' % ((region_pos[id(r)]+p) *(1,-1) # svg y value increases down @@ -366,8 +367,8 @@ class WorldRenderer (object): continue drawn_rts[id(rt)] = rt lines.extend([ - '' % ' '.join(['%d,%d' % ((region_pos[id(r)]+rt_start+p) *(1,-1) # svg y value increases down -- 2.26.2