@flexem/fc-gui 3.0.0-alpha.122 → 3.0.0-alpha.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -36164,12 +36164,19 @@ class graph_state_element_GraphStateElement {
|
|
|
36164
36164
|
}
|
|
36165
36165
|
}
|
|
36166
36166
|
changeGraph(stateId, graphResult) {
|
|
36167
|
+
// 检查元素是否已被销毁
|
|
36168
|
+
if (!this._element) {
|
|
36169
|
+
return;
|
|
36170
|
+
}
|
|
36167
36171
|
if (!graphResult.failed) {
|
|
36168
36172
|
const graph = graphResult.graph;
|
|
36169
36173
|
switch (graph.graphType) {
|
|
36170
36174
|
case _tmp_config["i" /* GraphType */].Image:
|
|
36171
36175
|
case _tmp_config["i" /* GraphType */].SVG:
|
|
36172
36176
|
const imageElement = this.getImageElement();
|
|
36177
|
+
if (!imageElement) {
|
|
36178
|
+
return;
|
|
36179
|
+
}
|
|
36173
36180
|
imageElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', graph.source);
|
|
36174
36181
|
this.doFaultFlicker(imageElement, stateId);
|
|
36175
36182
|
break;
|
|
@@ -36185,6 +36192,10 @@ class graph_state_element_GraphStateElement {
|
|
|
36185
36192
|
}
|
|
36186
36193
|
getImageElement() {
|
|
36187
36194
|
if (!this.imageElement) {
|
|
36195
|
+
// 检查 _element 是否已被销毁
|
|
36196
|
+
if (!this._element) {
|
|
36197
|
+
return null;
|
|
36198
|
+
}
|
|
36188
36199
|
this.imageElement = document.createElementNS('http://www.w3.org/2000/svg', 'image');
|
|
36189
36200
|
this.imageElement.setAttribute('width', this.width + '');
|
|
36190
36201
|
this.imageElement.setAttribute('height', this.height + '');
|
|
@@ -36196,7 +36207,7 @@ class graph_state_element_GraphStateElement {
|
|
|
36196
36207
|
return this.imageElement;
|
|
36197
36208
|
}
|
|
36198
36209
|
removeImageElement() {
|
|
36199
|
-
if (this.imageElement) {
|
|
36210
|
+
if (this.imageElement && this._element) {
|
|
36200
36211
|
this._element.removeChild(this.imageElement);
|
|
36201
36212
|
delete this.imageElement;
|
|
36202
36213
|
}
|