@antv/g-lite 2.0.12-alpha.0 → 2.1.0-alpha.0

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/Canvas.d.ts CHANGED
@@ -79,7 +79,6 @@ export declare class Canvas extends EventTarget implements ICanvas {
79
79
  */
80
80
  private frameId?;
81
81
  private inited;
82
- private destroyed;
83
82
  private readyPromise;
84
83
  private resolveReadyPromise;
85
84
  context: CanvasContext;
package/dist/index.esm.js CHANGED
@@ -3919,12 +3919,6 @@ function mergeDimensions(left, right, target, nonNegative, index) {
3919
3919
  unit = 'px';
3920
3920
  }
3921
3921
  }
3922
- // // format 'rad' 'turn' to 'deg'
3923
- // if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
3924
- // leftValue = convertAngleUnit(left);
3925
- // rightValue = convertAngleUnit(right);
3926
- // unit = 'deg';
3927
- // }
3928
3922
  return [
3929
3923
  leftValue,
3930
3924
  rightValue,
@@ -3947,6 +3941,9 @@ function convertAngleUnit(value) {
3947
3941
  else if (value.unit === UnitType.kTurns) {
3948
3942
  deg = turn2deg(Number(value.value));
3949
3943
  }
3944
+ else if (value.value) {
3945
+ deg = value.value;
3946
+ }
3950
3947
  return deg;
3951
3948
  }
3952
3949
  function parseDimensionArrayFormat(string, size) {
@@ -7463,12 +7460,14 @@ var parser = {
7463
7460
  mat4.set.apply(mat4, __spreadArray([$mat4_1], __read(d.map(function (s) { return s.value; })), false));
7464
7461
  },
7465
7462
  };
7463
+ var $vec3One$1 = vec3.fromValues(1, 1, 1);
7464
+ var $vec3Zero$1 = vec3.create();
7466
7465
  var optimizer = {
7467
7466
  translate: function (object, d) {
7468
- object.setLocalPosition([d[0].value, d[1].value]);
7469
- },
7470
- translate3d: function (object, d) {
7471
- object.setLocalPosition([d[0].value, d[1].value, d[2].value]);
7467
+ runtime.sceneGraphService.setLocalScale(object, $vec3One$1, false);
7468
+ runtime.sceneGraphService.setLocalEulerAngles(object, $vec3Zero$1, undefined, undefined, false);
7469
+ runtime.sceneGraphService.setLocalPosition(object, [d[0].value, d[1].value, 0], false);
7470
+ runtime.sceneGraphService.dirtifyLocal(object, object.transformable);
7472
7471
  },
7473
7472
  };
7474
7473
  function parsedTransformToMat4(transform, object) {
@@ -14284,7 +14283,6 @@ var Canvas = /** @class */ (function (_super) {
14284
14283
  */
14285
14284
  _this.Element = DisplayObject;
14286
14285
  _this.inited = false;
14287
- _this.destroyed = false;
14288
14286
  _this.context = {};
14289
14287
  // create document
14290
14288
  _this.document = new Document();
@@ -14505,7 +14503,7 @@ var Canvas = /** @class */ (function (_super) {
14505
14503
  clearEventRetain(beforeRenderEvent);
14506
14504
  clearEventRetain(rerenderEvent);
14507
14505
  clearEventRetain(afterRenderEvent);
14508
- this.destroyed = true;
14506
+ this.cancelAnimationFrame(this.frameId);
14509
14507
  };
14510
14508
  /**
14511
14509
  * compatible with G 3.0
@@ -14577,8 +14575,6 @@ var Canvas = /** @class */ (function (_super) {
14577
14575
  Canvas.prototype.run = function () {
14578
14576
  var _this = this;
14579
14577
  var tick = function (time, frame) {
14580
- if (_this.destroyed)
14581
- return _this.cancelAnimationFrame(_this.frameId);
14582
14578
  _this.render(frame);
14583
14579
  _this.frameId = _this.requestAnimationFrame(tick);
14584
14580
  };
@@ -14695,14 +14691,12 @@ var Canvas = /** @class */ (function (_super) {
14695
14691
  _this.unmountChildren(child);
14696
14692
  });
14697
14693
  if (this.inited) {
14698
- if (!this.getConfig().cleanUpOnDestroy) {
14699
- if (parent.isMutationObserved) {
14700
- parent.dispatchEvent(unmountedEvent);
14701
- }
14702
- else {
14703
- unmountedEvent.target = parent;
14704
- this.dispatchEvent(unmountedEvent, true);
14705
- }
14694
+ if (parent.isMutationObserved) {
14695
+ parent.dispatchEvent(unmountedEvent);
14696
+ }
14697
+ else {
14698
+ unmountedEvent.target = parent;
14699
+ this.dispatchEvent(unmountedEvent, true);
14706
14700
  }
14707
14701
  // skip document.documentElement
14708
14702
  if (parent !== this.document.documentElement) {