Handle bounding box when cairo.stroke_extents returns 0, 0, 0, 0
Description
This ticket is is similar to #1037 (closed)
Bounding box incorrectly calculated when cairo.stroke_extents return a zero rectangle. This in turns causes problem if rsvg_handle_render_element is used to render a single element.
compute_stroke_and_fill_extents
function doesn't handle the situation where an empty rectangle is returned from stroke_extents
.
Steps to reproduce
Save this as bug.svg:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" id="svg2779" width="4628" height="2510" version="1.1" viewBox="0 0 1224.5 664.1">
<g id="heart_2" transform="translate(.00130771 -.0073965)">
<path id="path107864" d="m106.38 275.58c0-1.895-1.409-3.326-3.309-3.326-1.836 0-3.245 1.56-3.245 3.586 0 1.17.506 1.914 1.298 1.914.697 0 1.108-.52 1.108-1.32 0-1.504-1.108-1.114-1.108-2.118 0-.78.76-1.579 1.472-1.579 1.014 0 1.568.948 1.568 2.564 0 3.55-2.39 5.147-4.655 9.588v.594c.317-.13.491-.167.665-.167h5.589c.206 0 .395.037.775.167l.333-4.756h-.665l-.127.78c-.142.91-.237 1.208-.348 1.32-.142.092-.174.092-1.06.11h-3.135c1.361-2.062 4.844-3.92 4.844-7.357z" fill="#e83630" stroke="#e83630" stroke-linejoin="round" stroke-width=".25"/>
</g>
</svg>
rsvg-convert.exe -w 1024 -h 1024 -i "#heart_2" bug.svg -o heart_2.png
Version
rsvg-convert version 2.57.1