Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
Handle circles and multiple paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnblk committed Apr 5, 2017
1 parent 6d248ea commit 3a6fc05
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions build.js
Expand Up @@ -42,8 +42,11 @@ const mdFiles = mdKeys.reduce((a, key) => {
}, {})

const getPath = $ => {
const d = $('path').attr('d')
return d
const paths = []
$('path').map((i, el) => {
paths.push($(el).attr('d'))
})
return paths.join(' ')
}

const getCircles = $ => {
Expand All @@ -57,15 +60,16 @@ const getCircles = $ => {
return circles
}

const convertCircleToPath = circle => {
const convertCircleToPath = (circle, i) => {
const { cx, cy, r } = circle
const x = cx
const y1 = cy - r
const y2 = cy + r
const direction = (i + 1) % 2
return [
'M', x, y1,
'A', r, r, 0, 0, 0, x, y2,
'A', r, r, 0, 0, 0, x, y1
'A', r, r, 0, 0, direction, x, y2,
'A', r, r, 0, 0, direction, x, y1
].join(' ')
}

Expand Down
2 changes: 1 addition & 1 deletion material-design-icons.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion simple-icons.js

Large diffs are not rendered by default.

0 comments on commit 3a6fc05

Please sign in to comment.