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.
@@ -499,7 +499,7 @@ export default class jmGraph extends jmControl {
499
499
  this.___isAutoRefreshing = true;
500
500
 
501
501
  function update() {
502
- if(self.destoryed) {
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
- destory() {
518
- this.eventHandler.destory();
519
- this.destoryed = true;// 标记已销毁
517
+ destroy() {
518
+ this.eventHandler.destroy();
519
+ this.destroyed = true;// 标记已销毁
520
520
  }
521
521
  }
522
522
 
@@ -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();