PDF Output: Fix a zero division error when the transformation matrix has a zero diagonal

This commit is contained in:
Kovid Goyal 2014-02-06 08:20:57 +05:30
parent 58eb2c2bc8
commit 4c036eeedd

View File

@ -407,7 +407,10 @@ class Graphics(object):
w = pen.widthF()
if pen.isCosmetic():
t = painter.transform()
w /= sqrt(t.m11()**2 + t.m22()**2)
try:
w /= sqrt(t.m11()**2 + t.m22()**2)
except ZeroDivisionError:
w = 0
pdf.serialize(w)
pdf.current_page.write(' w ')