-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
altered paths #1858
Comments
Hey! Thanks for reporting the issue. The issue is caused due to rounding. By default, SVGO reduces the precision of floating-point numbers to 5 decimal places. In most cases, this is fine. However, in this SVG some of the numbers are super inflated, with matrixes applied that are really miniscule. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 673 205">
<path d="M0 0L6235704.138785 2260595.537351" transform="matrix(0.0000431728,0,0,0.0000431865,60.47463,20.8221)" stroke-width="12700" stroke="black"/>
</svg> Here is a trimmed down version of the SVG that showcases the issue. See how the path commands use numbers like 6,235,704, and then to scale it down to fit in the viewport a transform is applied using numbers like For now, a workaround you can do is increase the transform precision of the
module.exports = {
plugins: [
{
name: "preset-default",
params: {
overrides: {
convertTransform: {
transformPrecision: 10
}
}
}
}
]
} |
Interesting! Is there a way to disable the float clipping entirely? |
As far as I know (reviewing documentation and the current implementation) we don't have anything to disable the rounding entirely. (Apart from disabling the plugin.) Later, I can review if we should allow passing |
Running
on
gives
This is with svgo 3.0.4.
The text was updated successfully, but these errors were encountered: