From 81927f361d48e3810b1d0b6174c53d02a0ee1c90 Mon Sep 17 00:00:00 2001 From: Frederic Back Date: Thu, 28 Sep 2006 18:51:15 +0000 Subject: * Restored the rainbow :-) * Cleaned the renderer somewhat git-svn-id: file:///home/lennart/svn/public/fring/trunk@48 d0d2c35f-0a1e-0410-abeb-dabff30a67ee --- src/fringlib/fringrenderer.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/fringlib/fringrenderer.py b/src/fringlib/fringrenderer.py index c5f8273..9b92418 100644 --- a/src/fringlib/fringrenderer.py +++ b/src/fringlib/fringrenderer.py @@ -78,14 +78,12 @@ class FringRenderer: accumulated = 0 last = start_angle - if datacontents is None: return - for fn, contents, d in datacontents: + for entry in datacontents: + fn, contents, value = entry - if contents == None: hasContents = False - else: hasContents = True + hasContents = contents != None start = last - value = d # third tuple element now *always* contains the size accumulated += value if datasize == 0: continue @@ -96,7 +94,6 @@ class FringRenderer: p = previouspath+os.sep+fn self.lookup_data[ring].append( Segment(hasContents , p, value, start, end) ) - v = start_hue + (end_hue-start_hue)*1.0*i/n color = self._choose_color(start_hue + (end_hue-start_hue)*1.0*i/n, ring) r = self.INNER_RADIUS + ring * (self.RING_RADIUS + self.RING_SPACE) @@ -113,8 +110,9 @@ class FringRenderer: ctx.stroke() if hasContents and ring+1 < self.RINGS_MAX: - self.draw_segment(ctx, ring+1, start, end, v, - start_hue + (end_hue-start_hue)*1.0*(i+1)/n, (fn, contents, d), + self.draw_segment(ctx, ring+1, start, end, + start_hue + (end_hue-start_hue)*1.0*i/n, + start_hue + (end_hue-start_hue)*1.0*(i+1)/n, entry, previouspath+os.sep+fn) r += self.RING_RADIUS/2 -- cgit