From 21f8c08acea0098dce67b92a660f8d7f733d2b06 Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Wed, 9 Jan 2008 05:13:27 +0000 Subject: [PATCH] 0001228: Descendent Chart doesn't respect the margin svn: r9757 --- ChangeLog | 7 ++++++- src/plugins/AncestorChart.py | 14 +++++++++++--- src/plugins/DescendChart.py | 14 +++++++++++--- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c7d6e6534..870683faf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2008-01-00 Brian Matherly +2008-01-08 Brian Matherly + * src/plugins/AncestorChart.py: + * src/plugins/DescendChart.py: + Fix 0001228: Descendent Chart doesn't respect the margin + +2008-01-08 Brian Matherly * src/DisplayModels/_BaseModel.py: Fix 0001554: Select Place search 2008-01-08 Jim Sack diff --git a/src/plugins/AncestorChart.py b/src/plugins/AncestorChart.py index 1ea391364..6d37ed80e 100644 --- a/src/plugins/AncestorChart.py +++ b/src/plugins/AncestorChart.py @@ -293,7 +293,15 @@ class AncestorChart(Report): gstyle = style_sheet.get_draw_style("AC2-box") shadow_height = gstyle.get_shadow_space() else: - self.offset = 0 + # Make space for the page number labels at the bottom. + p = style_sheet.get_paragraph_style("AC2-Normal") + font = p.get_font() + lheight = pt2cm(1.2*font.get_size()) + lwidth = pt2cm(1.1*self.doc.string_width(font,"(00,00)")) + self.page_label_x_offset = self.doc.get_usable_width() - lwidth + self.page_label_y_offset = self.doc.get_usable_height() - lheight + + self.offset = pt2cm(1.25 * font.get_size()) shadow_height = 0 self.uh = self.doc.get_usable_height() - self.offset - shadow_height uw = self.doc.get_usable_width() - pt2cm(self.box_pad_pts) @@ -410,8 +418,8 @@ class AncestorChart(Report): if not self.force_fit: self.doc.draw_text('AC2-box', '(%d,%d)' % (colx+1,coly+1), - self.doc.get_usable_width()+0.5, - self.doc.get_usable_height()+0.75) + self.page_label_x_offset, + self.page_label_y_offset) self.doc.end_page() def add_lines(self): diff --git a/src/plugins/DescendChart.py b/src/plugins/DescendChart.py index d0ea99249..21733bc62 100644 --- a/src/plugins/DescendChart.py +++ b/src/plugins/DescendChart.py @@ -269,7 +269,15 @@ class DescendChart(Report): gstyle = style_sheet.get_draw_style("DC2-box") shadow_height = gstyle.get_shadow_space() else: - self.offset = 0 + # Make space for the page number labels at the bottom. + p = style_sheet.get_paragraph_style("DC2-Normal") + font = p.get_font() + lheight = pt2cm(1.2*font.get_size()) + lwidth = pt2cm(1.1*self.doc.string_width(font,"(00,00)")) + self.page_label_x_offset = self.doc.get_usable_width() - lwidth + self.page_label_y_offset = self.doc.get_usable_height() - lheight + + self.offset = pt2cm(1.25 * font.get_size()) shadow_height = 0 self.uh = self.doc.get_usable_height() - self.offset - shadow_height uw = self.doc.get_usable_width() - pt2cm(self.box_pad_pts) @@ -385,8 +393,8 @@ class DescendChart(Report): if not self.force_fit: self.doc.draw_text('DC2-box', '(%d,%d)' % (colx+1,coly+1), - self.doc.get_usable_width()+0.5, - self.doc.get_usable_height()+0.75) + self.page_label_x_offset, + self.page_label_y_offset) self.doc.end_page() #------------------------------------------------------------------------