Skip to content

Commit

Permalink
fix(convertPathData): handle setting prev properly to fix path joinin…
Browse files Browse the repository at this point in the history
…g and #1855 (#1856)
  • Loading branch information
KTibow committed Nov 29, 2023
1 parent 86d5040 commit 8dd7a3b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 1 addition & 3 deletions plugins/convertPathData.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,15 +828,12 @@ function filters(

item.command = command;
item.args = data;

prev = item;
} else {
// z resets coordinates
relSubpoint[0] = pathBase[0];
relSubpoint[1] = pathBase[1];
// @ts-ignore
if (prev.command === 'Z' || prev.command === 'z') return false;
prev = item;
}
if (
(command === 'Z' || command === 'z') &&
Expand All @@ -849,6 +846,7 @@ function filters(
)
return false;

prev = item;
return true;
});

Expand Down
15 changes: 15 additions & 0 deletions test/plugins/convertPathData.29.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8dd7a3b

Please sign in to comment.