-
Notifications
You must be signed in to change notification settings - Fork 267
Open
Description
I have found that resvg renders this SVG inconsistently with Chromium/Firefox/Inkscape:
<svg xmlns="http://www.w3.org/2000/svg" height="1000" transform="scale(.5)" viewBox="5 5 100 100" width="1000">
<g>
<circle cx="10" cy="10" r="3" stroke="black" stroke-width=".1"/>
<circle cx="20" cy="10" r="3" stroke="black" stroke-width=".1"/>
<line stroke="black" stroke-width=".1" x1="10" x2="20" y1="10" y2="10"/>
</g>
</svg>
Here's a comparison of the output of Firefox/Chromium/Inkscape (left) and resvg (right):
I suspect the culprit here is probably the transform
on the root SVG coupled with viewBox
. I believe the support for transform
on the svg
element was added in SVG 2 and there have been inconsistencies among implementations in the past (see f.e. https://lists.w3.org/Archives/Public/www-svg/2015May/0024.html).
The output of resvg seems to be equivalent to rendering the following SVG with f.e. Firefox:
<svg xmlns="http://www.w3.org/2000/svg" height="1000" viewBox="5 5 100 100" width="1000">
<g transform="scale(.5)">
<circle cx="10" cy="10" r="3" stroke="black" stroke-width=".1"/>
<circle cx="20" cy="10" r="3" stroke="black" stroke-width=".1"/>
<line stroke="black" stroke-width=".1" x1="10" x2="20" y1="10" y2="10"/>
</g>
</svg>
Might be related to #874.
yisibl
Metadata
Metadata
Assignees
Labels
No labels