Skip to content

Commit

Permalink
fix: fix circles convertion when no cx/cy
Browse files Browse the repository at this point in the history
fix #162
  • Loading branch information
nfroidure committed Sep 8, 2024
1 parent cd86ee5 commit 13d9caf
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 47 deletions.
15 changes: 15 additions & 0 deletions fixtures/expected/realworld.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions fixtures/icons/realworld/omridevk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/svgshapes2svgpath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ function svgShapesToPathLineToPath(attributes) {
}

function svgShapesToPathCircleToPath(attributes) {
const cx = parseFloat(attributes.cx);
const cy = parseFloat(attributes.cy);
const cx = parseFloat(attributes.cx || 0);
const cy = parseFloat(attributes.cy || 0);
const rx =
'undefined' !== typeof attributes.rx
? parseFloat(attributes.rx)
Expand Down
6 changes: 6 additions & 0 deletions src/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ describe('Generating fonts to files', () => {
});
});

test('should work with realworld icons', async () => {
await generateFontToFile({
fontName: 'realworld',
});
});

test('should work with a lot of icons', async () => {
await generateFontToFile(
{
Expand Down
24 changes: 0 additions & 24 deletions src/tests/results/nestedicons-cli.svg

This file was deleted.

21 changes: 0 additions & 21 deletions src/tests/results/originalicons-cli.svg

This file was deleted.

0 comments on commit 13d9caf

Please sign in to comment.