Skip to content

Commit

Permalink
PDF Output: Fix a regression that caused the last page of a chapter t…
Browse files Browse the repository at this point in the history
…o sometimes be dropped from the output
  • Loading branch information
kovidgoyal committed Aug 10, 2016
1 parent c7c1b17 commit 15cf137
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/calibre/ebooks/pdf/render/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ def drawTextItem(self, point, text_item):
last_x, last_y = x, y

if not self.content_written_to_current_page:
ypositions = [y for x, y in gi.positions]
painter_top = self.painter().clipPath().boundingRect().y()
ypositions = [y - painter_top for x, y in gi.positions]
miny = min(ypositions or (0,))
maxy = max(ypositions or (self.pixel_height,))
page_top = self.header_height if self.has_headers else 0
Expand Down

0 comments on commit 15cf137

Please sign in to comment.