Permalink
Browse files

Reverted change - changing the way frame sizes are computed actually …

…breaks

stuff. Unfortunately we don't have tests to prove it yet :(
  • Loading branch information...
1 parent 000f26f commit 61df7d113b6ffb25a24cdff27308e5591d46fedd @chrisglass chrisglass committed May 27, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 xhtml2pdf/context.py
View
@@ -214,7 +214,7 @@ def _pisaDimensions(self, data, width, height):
# box = getCoords(left, top, width, height, self.c.pageSize)
# print "BOX", box
# print top, left, w, h
- return left, top, right - left, bottom - top
+ return left, top, right, bottom
def _pisaAddFrame(self, name, data, first=False, border=None, size=(0,0)):
c = self.c

7 comments on commit 61df7d1

mawe42 commented on 61df7d1 May 30, 2011

Hi. Can you give me a few pointers as to what actually breaks?

Contributor

chrisglass replied May 30, 2011

Yes, I'll even try to make a test html file for it, but on my local pdfs, frame sizes were wrong after this.

It should be correct however, so maybe "deeper" code makes up for the original error?

I think i've found the problem. Specifying frames with (left, top, width, height) worked, but using (left, top, bottom, right) failed. Last commit on my frame-size-bugfix branch fixes the problem.

Contributor

chrisglass replied May 30, 2011

Testing your changes now, but they seem very sane (I should have noticed the - sign at line 195... ).
I'll pull them in in a few minutes, most likely.

Contributor

chrisglass replied May 30, 2011

Ah well, it seems to have the same problem, even after your latest commit (on your frame-size-bugfix)...
I'll keep a local branch in sync with your changes and try to figure out what's wrong.

The branch has a new commit, hopefully it's fixed now. Added a unittest for the method as well. Removed the possibility of using "relative" sizes (like 12em, 14ex), as they were broken anyway. It used the page size as reference, so 12em would have been 12 * the page width or height.

Contributor

chrisglass replied May 31, 2011

Unfortunately the rendering of pdfs still borks for me.
What problem where you initially trying to fix with this? Perhaps we should move the discussion about this to a new pull request - it makes commenting much easier :)

Please sign in to comment.