From 42819924ae0227592d3c7f3992bee3bbf093ab4d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rg=20Lehmann?= Date: Sun, 15 May 2011 07:44:50 +0000 Subject: [PATCH] fix empty pages in documents git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@3088 069f4177-920e-0410-937b-c2a4a81bcd90 --- pyx/document.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pyx/document.py b/pyx/document.py index 97f363aa..8b225fa6 100644 --- a/pyx/document.py +++ b/pyx/document.py @@ -69,25 +69,18 @@ class page: self.pagebbox = bbox def _process(self, processMethod, contentfile, writer, context, registry, bbox): - - # check whether we expect a page trafo and use a temporary canvas to insert the - # page canvas - expectpagetrafo = self.paperformat and (self.rotated or self.centered or self.fittosize) - # usually, it is the bbox of the canvas enlarged by self.bboxenlarge, but # it might be a different bbox as specified in the page constructor assert not bbox if self.pagebbox: bbox.set(self.pagebbox) - elif bbox: - bbox.enlarge(self.bboxenlarge) else: bbox.set(self.canvas.bbox()) # this bbox is not accurate bbox.enlarge(self.bboxenlarge) - cc = self.canvas - if expectpagetrafo: - + # check whether we expect a page trafo and use a temporary canvas to insert the + # page canvas + if self.paperformat and (self.rotated or self.centered or self.fittosize) and bbox: # calculate the pagetrafo paperwidth, paperheight = self.paperformat.width, self.paperformat.height @@ -124,6 +117,8 @@ class page: bbox.transform(pagetrafo) cc = canvasmodule.canvas() cc.insert(self.canvas, [pagetrafo]) + else: + cc = self.canvas getattr(style.linewidth.normal, processMethod)(contentfile, writer, context, registry, bbox) if self.pagebbox: -- 2.11.4.GIT