* src/docgen/PSDrawDoc.py: Fix center_text and draw_bar

svn: r8099
This commit is contained in:
Brian Matherly 2007-02-13 04:34:01 +00:00
parent 8848e8c865
commit e543bef596
2 changed files with 11 additions and 9 deletions

View File

@ -2,6 +2,7 @@
* src/plugins/AncestorChart2.py: Fix title color * src/plugins/AncestorChart2.py: Fix title color
* src/plugins/DescendChart.py: Fix title color * src/plugins/DescendChart.py: Fix title color
* src/plugins/TimeLine.py: Fix title color * src/plugins/TimeLine.py: Fix title color
* src/docgen/PSDrawDoc.py: Fix center_text and draw_bar
2007-02-12 Don Allingham <don@gramps-project.org> 2007-02-12 Don Allingham <don@gramps-project.org>
* src/plugins/FindDupes.py: backport from 2.2.6 * src/plugins/FindDupes.py: backport from 2.2.6

View File

@ -191,13 +191,13 @@ class PSDrawDoc(BaseDoc.BaseDoc):
return (new_text,fdef) return (new_text,fdef)
def center_text(self,style,text,x,y): def center_text(self,style,text,x,y):
x += self.lmargin
y += self.tmargin
stype = self.draw_styles[style] stype = self.draw_styles[style]
pname = stype.get_paragraph_style() pname = stype.get_paragraph_style()
p = self.style_list[pname] p = self.style_list[pname]
x += self.lmargin
y = y + self.tmargin + ReportUtils.pt2cm(p.get_font().get_size())
(text,fdef) = self.encode_text(p,text) (text,fdef) = self.encode_text(p,text)
self.f.write('gsave\n') self.f.write('gsave\n')
@ -361,14 +361,15 @@ class PSDrawDoc(BaseDoc.BaseDoc):
y2 = y2 + self.tmargin y2 = y2 + self.tmargin
box_type = self.draw_styles[style] box_type = self.draw_styles[style]
fill_color = ReportUtils.rgb_color(box_type.get_fill_color()) fill_color = box_type.get_fill_color()
color = ReportUtils.rgb_color(box_type.get_color()) color = box_type.get_color()
self.f.write('gsave\n') self.f.write('gsave\n')
self.f.write("%s cm %s cm moveto\n" % coords(self.translate(x1,y1))) self.f.write("%s cm %s cm moveto\n" % coords(self.translate(x1,y1)))
self.f.write("0 %s cm rlineto\n" % gformat(y2-y1)) self.f.write("%s cm %s cm lineto\n" % coords(self.translate(x1,y2)))
self.f.write("%s cm 0 rlineto\n" % gformat(x2-x1)) self.f.write("%s cm %s cm lineto\n" % coords(self.translate(x2,y2)))
self.f.write("0 %s cm rlineto\n" % gformat(y1-y2)) self.f.write("%s cm %s cm lineto\n" % coords(self.translate(x2,y1)))
self.f.write("%s cm %s cm lineto\n" % coords(self.translate(x1,y1)))
self.f.write('closepath\n') self.f.write('closepath\n')
self.f.write("%s setlinewidth\n" % gformat(box_type.get_line_width())) self.f.write("%s setlinewidth\n" % gformat(box_type.get_line_width()))
self.f.write('gsave %s %s %s setrgbcolor fill grestore\n' % lrgb(fill_color)) self.f.write('gsave %s %s %s setrgbcolor fill grestore\n' % lrgb(fill_color))