1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-29 20:21:14 +03:00

Remove flag spaces for all arcs (#1484)

Ref #1476

The issue is that a path command may have multiple arcs, and the space optimization was only applied to the first one. Modified a test to check it.


Co-authored-by: Josep del Río <joseprio@fb.com>
Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>
This commit is contained in:
Josep del Rio
2021-08-12 19:51:26 +01:00
committed by GitHub
parent 9892e28a71
commit 454b4277a3
2 changed files with 5 additions and 3 deletions

View File

@ -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');
});
});