@antv/g-lite 2.0.11-alpha.6 → 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();
@@ -15119,6 +15122,7 @@ var Canvas = /** @class */ (function (_super) {
15119
15122
  this.context.rBushRoot = null;
15120
15123
  this.context.renderingContext.root = null;
15121
15124
  }
15125
+ this.destroyed = true;
15122
15126
  if (!skipTriggerEvent) {
15123
15127
  this.dispatchEvent(new CustomEvent(exports.CanvasEvent.AFTER_DESTROY));
15124
15128
  }
@@ -15193,6 +15197,8 @@ var Canvas = /** @class */ (function (_super) {
15193
15197
  Canvas.prototype.run = function () {
15194
15198
  var _this = this;
15195
15199
  var tick = function (time, frame) {
15200
+ if (_this.destroyed)
15201
+ return _this.cancelAnimationFrame(_this.frameId);
15196
15202
  _this.render(frame);
15197
15203
  _this.frameId = _this.requestAnimationFrame(tick);
15198
15204
  };