From 15a3999422628d4857306bdf3919d1546105942e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 26 Aug 2005 19:10:34 +0000 Subject: [PATCH] * src/plugins/DescendChart.py: Fix spacing and line drawing svn: r5127 --- gramps2/ChangeLog | 3 +++ gramps2/src/plugins/DescendChart.py | 30 ++++------------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index d0a8a9db0..8317f2c5b 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2005-08-26 Don Allingham + * src/plugins/DescendChart.py: Fix spacing and line drawing + 2005-08-25 Don Allingham * src/SubstKeywords: Add new % options * src/plugins/DescendChart.py: New descendant wall chart report diff --git a/gramps2/src/plugins/DescendChart.py b/gramps2/src/plugins/DescendChart.py index 51074716b..3cccd7e59 100644 --- a/gramps2/src/plugins/DescendChart.py +++ b/gramps2/src/plugins/DescendChart.py @@ -62,14 +62,6 @@ _LINE_HORIZONTAL = 1 _LINE_VERTICAL = 2 _LINE_ANGLE = 3 -#------------------------------------------------------------------------ -# -# log2val -# -#------------------------------------------------------------------------ -def log2(val): - return int(math.log10(val)/math.log10(2)) - #------------------------------------------------------------------------ # # Layout class @@ -85,8 +77,6 @@ class GenChart: self.max_x = 0 self.max_y = 0 - #self.ad = (self.size,generations) - def get_xy(self,x,y): if not self.array.has_key(y): return 0 @@ -103,13 +93,6 @@ class GenChart: def dimensions(self): return (self.max_y+1,self.max_x+1) - def display(self): - for y in range(0,self.max_y+1): - print "%04d " % y, - for x in range(0,self.max_x+1): - print self.get_xy(x,y), - print "" - def not_blank(self,line): for i in line: if i and type(i) == tuple: @@ -202,7 +185,7 @@ class DescendChart(Report.Report): def add_lines(self): - (maxx,maxy) = self.genchart.dimensions() + (maxy,maxx) = self.genchart.dimensions() for y in range(0,maxy+1): for x in range(0,maxx+1): @@ -218,11 +201,6 @@ class DescendChart(Report.Report): else: continue - # shortcut - if the spot directly below is used, then - # we have no more children, and can break - if self.genchart.get_xy(x,y+1): - continue - # look through the entries below this one. All people in the # next column are descendants until we hit a person in our own # column. @@ -247,7 +225,7 @@ class DescendChart(Report.Report): page = 1 (maxy,maxx) = self.genchart.dimensions() maxx = (maxx-1)*2 - maxh = int(self.uh/self.box_height) + maxh = int(self.uh/(self.box_height*1.25)) if self.force_fit: self.print_page(0,maxx,0,maxy,0,0) @@ -294,7 +272,7 @@ class DescendChart(Report.Report): (maxy,maxx) = self.genchart.dimensions() bw = (calc_width/(uw/(maxx+1))) - bh = self.box_height/(self.uh/maxy) + bh = (self.box_height*(1.25))/(self.uh/maxy) self.scale = max(bw/2,bh) self.box_width = self.box_width/self.scale @@ -302,7 +280,7 @@ class DescendChart(Report.Report): self.box_pad_pts = self.box_pad_pts/self.scale self.box_gap = self.box_gap/self.scale - maxh = int(self.uh/(self.box_height+self.box_gap)) + maxh = int((self.uh)/(self.box_height+self.box_gap)) maxw = int(uw/calc_width) # build array of x indices