jmgraph 3.1.93 → 3.1.95
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.
- package/dist/jmgraph.core.min.js +1 -1
- package/dist/jmgraph.core.min.js.map +1 -1
- package/dist/jmgraph.js +19 -14
- package/dist/jmgraph.min.js +1 -1
- package/package.json +1 -1
- package/src/core/jmEvents.js +5 -5
- package/src/core/jmGraph.js +4 -4
- package/src/shapes/jmImage.js +5 -1
package/src/core/jmGraph.js
CHANGED
|
@@ -499,7 +499,7 @@ export default class jmGraph extends jmControl {
|
|
|
499
499
|
this.___isAutoRefreshing = true;
|
|
500
500
|
|
|
501
501
|
function update() {
|
|
502
|
-
if(self.
|
|
502
|
+
if(self.destroyed) {
|
|
503
503
|
self.___isAutoRefreshing = false;
|
|
504
504
|
return;// 已销毁
|
|
505
505
|
}
|
|
@@ -514,9 +514,9 @@ export default class jmGraph extends jmControl {
|
|
|
514
514
|
}
|
|
515
515
|
|
|
516
516
|
// 销毁当前对象
|
|
517
|
-
|
|
518
|
-
this.eventHandler.
|
|
519
|
-
this.
|
|
517
|
+
destroy() {
|
|
518
|
+
this.eventHandler.destroy();
|
|
519
|
+
this.destroyed = true;// 标记已销毁
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
|
package/src/shapes/jmImage.js
CHANGED
|
@@ -87,7 +87,7 @@ export default class jmImage extends jmControl {
|
|
|
87
87
|
try {
|
|
88
88
|
|
|
89
89
|
let img = this.getImage();
|
|
90
|
-
if(this.graph.isWXMiniApp && this.graph.canvas) {
|
|
90
|
+
if(this.graph.isWXMiniApp && this.graph.canvas && typeof img === 'string') {
|
|
91
91
|
// 图片对象
|
|
92
92
|
const image = this.graph.canvas.createImage();
|
|
93
93
|
// 图片加载完成回调
|
|
@@ -109,6 +109,10 @@ export default class jmImage extends jmControl {
|
|
|
109
109
|
|
|
110
110
|
// 绘制
|
|
111
111
|
drawImg(img) {
|
|
112
|
+
if(!img) {
|
|
113
|
+
console.warn('image is empty');
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
112
116
|
let bounds = this.parent && this.parent.absoluteBounds?this.parent.absoluteBounds:this.absoluteBounds;
|
|
113
117
|
if(!bounds) bounds = this.parent && this.parent.getAbsoluteBounds?this.parent.getAbsoluteBounds():this.getAbsoluteBounds();
|
|
114
118
|
let p = this.getLocation();
|