8102: Fix problem with fanchart if max_generation = 1
This commit is contained in:
parent
d716146e9d
commit
cd540cdb13
@ -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],
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user