Skip to content

Commit cb6b60d

Browse files
committed
fix behavior of colorElement() and restoreElement() when fill/stroke is "none"
1 parent bb988ee commit cb6b60d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

js/jquery.graphviz.svg.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@
367367
$el.find('polygon, ellipse, path').each(function() {
368368
var $this = $(this)
369369
var color = $this.data('graphviz.svg.color')
370-
if (color.fill && $this.prop('tagName') != 'path') {
370+
if (color.fill && color.fill != "none" && $this.prop('tagName') != 'path') {
371371
$this.attr('fill', getColor(color.fill, bg)) // don't set fill if it's a path
372372
}
373-
if (color.stroke) {
373+
if (color.stroke && color.stroke != "none") {
374374
$this.attr('stroke', getColor(color.stroke, bg))
375375
}
376376
})
@@ -380,10 +380,10 @@
380380
$el.find('polygon, ellipse, path').each(function() {
381381
var $this = $(this)
382382
var color = $this.data('graphviz.svg.color')
383-
if (color.fill) {
383+
if (color.fill && color.fill != "none") {
384384
$this.attr('fill', color.fill) // don't set fill if it's a path
385385
}
386-
if (color.stroke) {
386+
if (color.stroke && color.stroke != "none") {
387387
$this.attr('stroke', color.stroke)
388388
}
389389
})

0 commit comments

Comments
 (0)