fix a potention bug of unexpected type 'float'

This commit is contained in:
2022-07-26 21:16:11 +08:00 committed by GitHub
parent c8059f3cd1
commit cd5960d2d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,8 +34,8 @@ def rasterize_svg(data=TEST_SVG, sizes=(), width=0, height=0, print=None, fmt='P
svg = QSvgRenderer(QByteArray(data))
size = svg.defaultSize()
if size.width() == 100 and size.height() == 100 and sizes:
size.setWidth(sizes[0])
size.setHeight(sizes[1])
size.setWidth(int(sizes[0]))
size.setHeight(int(sizes[1]))
if width or height:
size.scale(int(width), int(height), Qt.AspectRatioMode.KeepAspectRatio)
if print is not None: