This commit is contained in:
Kovid Goyal 2013-09-05 11:02:07 +05:30
parent 9c5d2646e3
commit 80887a8a14

View File

@ -150,7 +150,8 @@ class PdfEngine(QPaintEngine):
return QPaintEngine.Pdf return QPaintEngine.Pdf
def add_image(self, img, cache_key): def add_image(self, img, cache_key):
if img.isNull(): return if img.isNull():
return
return self.pdf.add_image(img, cache_key) return self.pdf.add_image(img, cache_key)
@store_error @store_error
@ -271,7 +272,8 @@ class PdfEngine(QPaintEngine):
@store_error @store_error
def drawPolygon(self, points, mode): def drawPolygon(self, points, mode):
self.apply_graphics_state() self.apply_graphics_state()
if not points: return if not points:
return
p = Path() p = Path()
p.move_to(points[0].x(), points[0].y()) p.move_to(points[0].x(), points[0].y())
for point in points[1:]: for point in points[1:]:
@ -305,7 +307,6 @@ class PdfEngine(QPaintEngine):
class PdfDevice(QPaintDevice): # {{{ class PdfDevice(QPaintDevice): # {{{
def __init__(self, file_object, page_size=A4, left_margin=inch, def __init__(self, file_object, page_size=A4, left_margin=inch,
top_margin=inch, right_margin=inch, bottom_margin=inch, top_margin=inch, right_margin=inch, bottom_margin=inch,
xdpi=1200, ydpi=1200, errors=print, debug=print, xdpi=1200, ydpi=1200, errors=print, debug=print,