diff --git a/lib/path.js b/lib/path.js index f8d4822b..7525341a 100644 --- a/lib/path.js +++ b/lib/path.js @@ -278,7 +278,8 @@ const stringifyArgs = ({ if ( disableSpaceAfterFlags && (command === 'A' || command === 'a') && - (i === 4 || i === 5) + // consider combined arcs + (i % 7 === 4 || i % 7 === 5) ) { result += numberString; } else if (i === 0 || numberString.startsWith('-')) { diff --git a/lib/path.test.js b/lib/path.test.js index f8edc3d8..04f7d516 100644 --- a/lib/path.test.js +++ b/lib/path.test.js @@ -165,18 +165,19 @@ describe('stringify path data', () => { { command: 'M', args: [0, 0] }, { command: 'A', args: [50, 50, 10, 1, 0, 0.2, 20] }, { command: 'a', args: [50, 50, 10, 1, 0, 0.2, 20] }, + { command: 'a', args: [50, 50, 10, 1, 0, 0.2, 20] }, ]; expect( stringifyPathData({ pathData, disableSpaceAfterFlags: false, }) - ).toEqual('M0 0A50 50 10 1 0 .2 20a50 50 10 1 0 .2 20'); + ).toEqual('M0 0A50 50 10 1 0 .2 20a50 50 10 1 0 .2 20 50 50 10 1 0 .2 20'); expect( stringifyPathData({ pathData, disableSpaceAfterFlags: true, }) - ).toEqual('M0 0A50 50 10 10.2 20a50 50 10 10.2 20'); + ).toEqual('M0 0A50 50 10 10.2 20a50 50 10 10.2 20 50 50 10 10.2 20'); }); });