From cd540cdb1318d0bab0dff2ed15370895ef566a23 Mon Sep 17 00:00:00 2001 From: Bastien Jacquet Date: Wed, 5 Nov 2014 23:22:48 +0100 Subject: [PATCH] 8102: Fix problem with fanchart if max_generation = 1 --- gramps/gui/widgets/fanchart.py | 2 +- gramps/gui/widgets/fanchartdesc.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gramps/gui/widgets/fanchart.py b/gramps/gui/widgets/fanchart.py index 9a18d01d4..002cecc62 100644 --- a/gramps/gui/widgets/fanchart.py +++ b/gramps/gui/widgets/fanchart.py @@ -350,7 +350,7 @@ class FanChartBaseWidget(Gtk.DrawingArea): self.maincolor = cstart elif self.background == BACKGROUND_GRAD_GEN: #compute the colors, -1, 0, ..., maxgen - divs = [x/(maxgen-1) for x in range(maxgen)] + divs = [x/(maxgen-1) for x in range(maxgen)] if maxgen>1 else [0] rgb_colors = [colorsys.hsv_to_rgb( (1-x) * self.cstart_hsv[0] + x * self.cend_hsv[0], (1-x) * self.cstart_hsv[1] + x * self.cend_hsv[1], diff --git a/gramps/gui/widgets/fanchartdesc.py b/gramps/gui/widgets/fanchartdesc.py index 3b0024208..9dc9ef167 100644 --- a/gramps/gui/widgets/fanchartdesc.py +++ b/gramps/gui/widgets/fanchartdesc.py @@ -158,10 +158,10 @@ class FanChartDescWidget(FanChartBaseWidget): self.gen2fam[0] = [] #no families self.angle = {} self.angle[-2] = [] - for i in range(1, self.generations-1): + for i in range(1, self.generations+1): self.gen2fam[i] = [] self.gen2people[i] = [] - self.gen2people[self.generations-1] = [] #indication of more children + self.gen2people[self.generations] = [] #indication of more children self.rotfactor = 1 self.rotstartangle = 0 if self.form == FORM_HALFCIRCLE: