@antv/g-lite 2.0.11-alpha.5 → 2.0.11-alpha.7

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/index.js CHANGED
@@ -10882,6 +10882,8 @@ var DefaultSceneGraphService = /** @class */ (function () {
10882
10882
  var p = element;
10883
10883
  // only need to re-render itself
10884
10884
  if (p.renderable) {
10885
+ if (!p.renderable.rendered)
10886
+ return;
10885
10887
  p.renderable.dirty = true;
10886
10888
  }
10887
10889
  while (p) {
@@ -14910,6 +14912,7 @@ var Canvas = /** @class */ (function (_super) {
14910
14912
  */
14911
14913
  _this.Element = DisplayObject;
14912
14914
  _this.inited = false;
14915
+ _this.destroyed = false;
14913
14916
  _this.context = {};
14914
14917
  // create document
14915
14918
  _this.document = new Document();
@@ -15103,9 +15106,10 @@ var Canvas = /** @class */ (function (_super) {
15103
15106
  // unmount all children
15104
15107
  var root = this.getRoot();
15105
15108
  this.unmountChildren(root);
15106
- if (cleanUp && !fastCleanExistingCanvas) {
15109
+ if (cleanUp) {
15107
15110
  // destroy Document
15108
- this.document.destroy();
15111
+ if (!fastCleanExistingCanvas)
15112
+ this.document.destroy();
15109
15113
  this.getEventService().destroy();
15110
15114
  }
15111
15115
  // destroy services
@@ -15118,6 +15122,7 @@ var Canvas = /** @class */ (function (_super) {
15118
15122
  this.context.rBushRoot = null;
15119
15123
  this.context.renderingContext.root = null;
15120
15124
  }
15125
+ this.destroyed = true;
15121
15126
  if (!skipTriggerEvent) {
15122
15127
  this.dispatchEvent(new CustomEvent(exports.CanvasEvent.AFTER_DESTROY));
15123
15128
  }
@@ -15192,6 +15197,8 @@ var Canvas = /** @class */ (function (_super) {
15192
15197
  Canvas.prototype.run = function () {
15193
15198
  var _this = this;
15194
15199
  var tick = function (time, frame) {
15200
+ if (_this.destroyed)
15201
+ return _this.cancelAnimationFrame(_this.frameId);
15195
15202
  _this.render(frame);
15196
15203
  _this.frameId = _this.requestAnimationFrame(tick);
15197
15204
  };