mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF Output: Fix a zero division error when the transformation matrix has a zero diagonal
This commit is contained in:
parent
58eb2c2bc8
commit
4c036eeedd
@ -407,7 +407,10 @@ class Graphics(object):
|
||||
w = pen.widthF()
|
||||
if pen.isCosmetic():
|
||||
t = painter.transform()
|
||||
try:
|
||||
w /= sqrt(t.m11()**2 + t.m22()**2)
|
||||
except ZeroDivisionError:
|
||||
w = 0
|
||||
pdf.serialize(w)
|
||||
pdf.current_page.write(' w ')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user