PDF Output: Fix a regression that caused the last page of a chapter to sometimes be dropped from the output

This commit is contained in:
Kovid Goyal 2016-08-10 13:07:02 +05:30
parent c7c1b175f3
commit 15cf137793

View File

@ -285,7 +285,8 @@ class PdfEngine(QPaintEngine):
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