1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-04 16:07:57 +03:00

Merge branch '53.x' of github.com:Kozea/WeasyPrint into 53.x

This commit is contained in:
Guillaume Ayoub 2021-11-04 09:35:24 +01:00
commit e386bc314c
2 changed files with 25 additions and 0 deletions

View File

@ -419,3 +419,26 @@ def test_rect_stroke_zero():
stroke-width="0" stroke="red" fill="none" />
</svg>
''')
@assert_no_logs
def test_rect_width_height_zero():
assert_pixels('rect_fill', 9, 9, '''
_________
_________
_________
_________
_________
_________
_________
_________
_________
''', '''
<style>
@page { size: 9px }
svg { display: block }
</style>
<svg width="0" height="0" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="2" width="5" height="5" fill="red" />
</svg>
''')

View File

@ -81,6 +81,8 @@ class SVGImage:
ratio = None
elif width and height:
ratio = width / height
else:
ratio = 1
return width, height, ratio
def draw(self, stream, concrete_width, concrete_height, image_rendering):