diff --git a/package.json b/package.json index deb9f1e..540ebd4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vesoft-inc/veditor", - "version": "4.4.12", + "version": "4.4.14", "description": "svg flow editor", "main": "./dist/VEditor.js", "types": "./types/index.d.ts", diff --git a/public/flowChart.html b/public/flowChart.html index 3503151..bb615db 100644 --- a/public/flowChart.html +++ b/public/flowChart.html @@ -2,6 +2,7 @@
+ \ No newline at end of file diff --git a/src/Shape/Graph.ts b/src/Shape/Graph.ts index 6dc94f4..f029f76 100644 --- a/src/Shape/Graph.ts +++ b/src/Shape/Graph.ts @@ -158,7 +158,10 @@ class Graph extends Utils.Event { initDefs() { - if(document.getElementById("ve-svg-defs")) return; + if (document.getElementById("ve-svg-defs")) { + this.shadow = document.getElementById("ve-svg-defs") as unknown as SVGSVGElement; + return; + }; this.shadow = svgWrapper( ` @@ -193,6 +196,8 @@ class Graph extends Utils.Event { destroy() { this.clearGraph(); this.clear(); + this.shadow.remove(); + this.shadow = undefined; document.removeEventListener("keydown", this.onKeyDown); } } diff --git a/src/Shape/Line.ts b/src/Shape/Line.ts index 7d54b18..ecd9f0c 100644 --- a/src/Shape/Line.ts +++ b/src/Shape/Line.ts @@ -246,6 +246,7 @@ class Line { line.arrow.remove(); line.arrow = null; line.dom.remove(); + line.label = null; this.activeLine = null; } @@ -591,6 +592,7 @@ class Line { for (let key in lines) { this.deleteLine(lines[key].data, true); } + this.activeLine = null; } } export default Line; diff --git a/src/Shape/Lines/Line.ts b/src/Shape/Lines/Line.ts index b7ef43f..6d4c192 100644 --- a/src/Shape/Lines/Line.ts +++ b/src/Shape/Lines/Line.ts @@ -255,7 +255,7 @@ const DefaultLine: LineRender = { ); } line.shape.appendChild(line.label.labelGroup); - const { text, textRect, textBBox, oldText, labelGroup } = line.label; + const { text, textBBox, oldText, labelGroup } = line.label; const x = xPoint + (refX || 0); const y = yPoint + (refY || 0); text.textContent = label; diff --git a/src/Shape/Node.ts b/src/Shape/Node.ts index c83ea70..095c23e 100644 --- a/src/Shape/Node.ts +++ b/src/Shape/Node.ts @@ -469,6 +469,7 @@ class Node { for (let key in nodes) { this.deleteNode(nodes[key].data, true); } + this.actives = {}; } } export default Node; \ No newline at end of file