Skip to content

Commit

Permalink
fix behavior of colorElement() and restoreElement() when fill/stroke …
Browse files Browse the repository at this point in the history
…is "none"
  • Loading branch information
michkot committed Apr 15, 2020
1 parent bb988ee commit 2a99a4e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/jquery.graphviz.svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,10 @@
$el.find('polygon, ellipse, path').each(function() {
var $this = $(this)
var color = $this.data('graphviz.svg.color')
if (color.fill && $this.prop('tagName') != 'path') {
if (if (color.fill && color.fill != "none" && $this.prop('tagName') != 'path') {
$this.attr('fill', getColor(color.fill, bg)) // don't set fill if it's a path
}
if (color.stroke) {
if (color.stroke && color.stroke) {
$this.attr('stroke', getColor(color.stroke, bg))
}
})
Expand All @@ -380,10 +380,10 @@
$el.find('polygon, ellipse, path').each(function() {
var $this = $(this)
var color = $this.data('graphviz.svg.color')
if (color.fill) {
if (if (color.fill && color.fill != "none") {
$this.attr('fill', color.fill) // don't set fill if it's a path
}
if (color.stroke) {
if (color.stroke && color.stroke) {
$this.attr('stroke', color.stroke)
}
})
Expand Down

0 comments on commit 2a99a4e

Please sign in to comment.