fix error on empty label

This commit is contained in:
Hiroyasu Nishiyama 2020-05-17 11:44:23 +09:00
parent 243915516e
commit 5f5e6ea845
1 changed files with 12 additions and 10 deletions

View File

@ -4287,16 +4287,18 @@ if (DEBUG_EVENTS) { console.warn("nodeMouseDown", mouse_mode,d); }
.style("fill", d.style.hasOwnProperty('color')?d.style.color:"#999")
.attr("transform","translate("+labelX+","+labelY+")")
.attr("text-anchor",labelAnchor);
var ypos = 0;
g.selectAll(".red-ui-flow-group-label-text").remove();
d.labels.forEach(function (name) {
label.append("tspan")
.classed("red-ui-flow-group-label-text", true)
.text(name)
.attr("x", 0)
.attr("y", ypos);
ypos += 15;
});
if (d.labels) {
var ypos = 0;
g.selectAll(".red-ui-flow-group-label-text").remove();
d.labels.forEach(function (name) {
label.append("tspan")
.classed("red-ui-flow-group-label-text", true)
.text(name)
.attr("x", 0)
.attr("y", ypos);
ypos += 15;
});
}
}
delete dirtyGroups[d.id];