Skip to content

Commit

Permalink
improve code readability and style
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinerg committed Dec 6, 2018
1 parent e24f167 commit e76c52b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/util/inkscape.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class Inkscape {
var m = style.match(fillOpacityZero)

if (m) {
var rgbFill = m[1] + `fill: rgb(${bgColor[0]},${bgColor[1]},${bgColor[2]});`
var sep = m[1]
var rgbFill = `${sep}fill: rgb(${bgColor[0]},${bgColor[1]},${bgColor[2]});`
style = style.replace(m[0], rgbFill)
node.setAttribute('style', style)
}
Expand Down Expand Up @@ -139,7 +140,7 @@ class Inkscape {
if (rgba[3] === 0) {
node.remove()
} else {
var rgbFill = sep + 'fill: rgb(' + rgba.slice(0, 3) + ')'
var rgbFill = `${sep}fill: rgb(${rgba.slice(0, 3).join(',')})`
style = style.replace(m[0], rgbFill)
node.setAttribute('style', style)
}
Expand Down

0 comments on commit e76c52b

Please sign in to comment.