Skip to content
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

fix(mergePaths): use a default floatPrecision #1945

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/03-plugins/merge-paths.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ svgo:
default: false
floatPrecision:
description: Number of decimal places to round to, using conventional rounding rules.
default: null
default: 3
noSpaceAfterFlags:
description: If to omit spaces after flags. Flags are values that can only be <code>0</code> or <code>1</code> and are used by some path commands, namely <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/d#elliptical_arc_curve" target="_blank"><code>A</code> and <code>a</code></a>.
default: false
Expand Down
2 changes: 1 addition & 1 deletion plugins/mergePaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const description = 'merges multiple paths in one if possible';
export const fn = (root, params) => {
const {
force = false,
floatPrecision,
floatPrecision = 3,
noSpaceAfterFlags = false, // a20 60 45 0 1 30 20 → a20 60 45 0130 20
} = params;
const stylesheet = collectStylesheet(root);
Expand Down