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

@ -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('-')) {