@antv/g-lite 1.3.0-next.13 → 1.3.0-next.15

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
@@ -6732,6 +6732,9 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6732
6732
  object.geometry.dirty = true;
6733
6733
  object.renderable.boundsDirty = true;
6734
6734
  object.renderable.renderBoundsDirty = true;
6735
+ if (!options.forceUpdateGeometry) {
6736
+ this.runtime.sceneGraphService.dirtifyToRoot(object);
6737
+ }
6735
6738
  }
6736
6739
  }
6737
6740
  else {
@@ -6793,6 +6796,9 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6793
6796
  object.geometry.dirty = true;
6794
6797
  object.renderable.boundsDirty = true;
6795
6798
  object.renderable.renderBoundsDirty = true;
6799
+ if (!options.forceUpdateGeometry) {
6800
+ this.runtime.sceneGraphService.dirtifyToRoot(object);
6801
+ }
6796
6802
  }
6797
6803
  attributeNames_1.forEach(function (name) {
6798
6804
  if (name in object.parsedStyle) {
@@ -7418,7 +7424,6 @@ var CSSPropertyPath = /** @class */ (function () {
7418
7424
  rect: new Rectangle(0, 0, 0, 0),
7419
7425
  };
7420
7426
  }
7421
- console.log('parsed', parsed);
7422
7427
  return parsed;
7423
7428
  };
7424
7429
  return CSSPropertyPath;
@@ -7846,6 +7851,7 @@ function createSkewMatrix(skewMatrix, skewX, skewY) {
7846
7851
  skewMatrix[1] = Math.tan(skewY); // Skew X axis in Y direction
7847
7852
  return skewMatrix;
7848
7853
  }
7854
+ var SCALE_EPSILON = 0.00001;
7849
7855
  var tmpMat1 = glMatrix.mat4.create();
7850
7856
  var tmpMat2 = glMatrix.mat4.create();
7851
7857
  function parsedTransformToMat4(transform, object) {
@@ -7855,23 +7861,27 @@ function parsedTransformToMat4(transform, object) {
7855
7861
  var t = parsed.t, d = parsed.d;
7856
7862
  if (t === 'scale') {
7857
7863
  // scale(1) scale(1, 1)
7858
- var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1];
7864
+ var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return Math.max(s.value, SCALE_EPSILON); })) || [
7865
+ 1, 1,
7866
+ ];
7859
7867
  glMatrix.mat4.fromScaling(tmpMat2, [newScale[0], newScale[1], 1]);
7860
7868
  }
7861
7869
  else if (t === 'scalex') {
7862
- var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
7870
+ var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return Math.max(s.value, SCALE_EPSILON); })) || [1];
7863
7871
  glMatrix.mat4.fromScaling(tmpMat2, [newScale[0], 1, 1]);
7864
7872
  }
7865
7873
  else if (t === 'scaley') {
7866
- var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
7874
+ var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return Math.max(s.value, SCALE_EPSILON); })) || [1];
7867
7875
  glMatrix.mat4.fromScaling(tmpMat2, [1, newScale[0], 1]);
7868
7876
  }
7869
7877
  else if (t === 'scalez') {
7870
- var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
7878
+ var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return Math.max(s.value, SCALE_EPSILON); })) || [1];
7871
7879
  glMatrix.mat4.fromScaling(tmpMat2, [1, 1, newScale[0]]);
7872
7880
  }
7873
7881
  else if (t === 'scale3d') {
7874
- var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1, 1];
7882
+ var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return Math.max(s.value, SCALE_EPSILON); })) || [
7883
+ 1, 1, 1,
7884
+ ];
7875
7885
  glMatrix.mat4.fromScaling(tmpMat2, [newScale[0], newScale[1], newScale[2]]);
7876
7886
  }
7877
7887
  else if (t === 'translate') {
@@ -11658,7 +11668,16 @@ var entityCounter = 0;
11658
11668
  function resetEntityCounter() {
11659
11669
  entityCounter = 0;
11660
11670
  }
11661
- new MutationEvent(exports.ElementEvent.INSERTED, null, '', '', '', 0, '', '');
11671
+ // const insertedEvent = new MutationEvent(
11672
+ // ElementEvent.INSERTED,
11673
+ // null,
11674
+ // '',
11675
+ // '',
11676
+ // '',
11677
+ // 0,
11678
+ // '',
11679
+ // '',
11680
+ // );
11662
11681
  var removedEvent = new MutationEvent(exports.ElementEvent.REMOVED, null, '', '', '', 0, '', '');
11663
11682
  var destroyEvent = new CustomEvent(exports.ElementEvent.DESTROY);
11664
11683
  /**
@@ -12284,7 +12303,20 @@ var DEFAULT_PARSED_STYLE_PROPS = {
12284
12303
  shadowType: 'outer',
12285
12304
  miterLimit: 10,
12286
12305
  };
12287
- tslib.__assign(tslib.__assign({}, DEFAULT_PARSED_STYLE_PROPS), { opacity: 1, fillOpacity: 1, strokeOpacity: 1, visibility: 'visible', pointerEvents: 'auto', lineWidth: 1, lineCap: 'butt', lineJoin: 'miter', increasedLineWidthForHitTesting: 0, fillRule: 'nonzero' });
12306
+ // const DEFAULT_PARSED_STYLE_PROPS_CSS_DISABLED = {
12307
+ // ...DEFAULT_PARSED_STYLE_PROPS,
12308
+ // opacity: 1,
12309
+ // fillOpacity: 1,
12310
+ // strokeOpacity: 1,
12311
+ // visibility: 'visible',
12312
+ // pointerEvents: 'auto',
12313
+ // lineWidth: 1,
12314
+ // lineCap: 'butt',
12315
+ // lineJoin: 'miter',
12316
+ // increasedLineWidthForHitTesting: 0,
12317
+ // fillRule: 'nonzero',
12318
+ // // TODO: transformOrigin
12319
+ // };
12288
12320
  var INHERITABLE_BASE_STYLE_PROPS = [
12289
12321
  'opacity',
12290
12322
  'fillOpacity',
@@ -12996,9 +13028,7 @@ var Circle = /** @class */ (function (_super) {
12996
13028
  tslib.__extends(Circle, _super);
12997
13029
  function Circle(options) {
12998
13030
  if (options === void 0) { options = {}; }
12999
- var _this = _super.call(this, options) || this;
13000
- _this.nodeName = exports.Shape.CIRCLE;
13001
- return _this;
13031
+ return _super.call(this, tslib.__assign({ type: exports.Shape.CIRCLE }, options)) || this;
13002
13032
  }
13003
13033
  return Circle;
13004
13034
  }(DisplayObject));
@@ -13029,9 +13059,7 @@ var Ellipse = /** @class */ (function (_super) {
13029
13059
  tslib.__extends(Ellipse, _super);
13030
13060
  function Ellipse(options) {
13031
13061
  if (options === void 0) { options = {}; }
13032
- var _this = _super.call(this, options) || this;
13033
- _this.nodeName = exports.Shape.ELLIPSE;
13034
- return _this;
13062
+ return _super.call(this, tslib.__assign({ type: exports.Shape.ELLIPSE }, options)) || this;
13035
13063
  }
13036
13064
  return Ellipse;
13037
13065
  }(DisplayObject));
@@ -13050,9 +13078,7 @@ var Group = /** @class */ (function (_super) {
13050
13078
  tslib.__extends(Group, _super);
13051
13079
  function Group(options) {
13052
13080
  if (options === void 0) { options = {}; }
13053
- var _this = _super.call(this, options) || this;
13054
- _this.nodeName = exports.Shape.GROUP;
13055
- return _this;
13081
+ return _super.call(this, tslib.__assign({ type: exports.Shape.GROUP }, options)) || this;
13056
13082
  }
13057
13083
  return Group;
13058
13084
  }(DisplayObject));
@@ -13127,9 +13153,7 @@ var Image = /** @class */ (function (_super) {
13127
13153
  tslib.__extends(Image, _super);
13128
13154
  function Image(options) {
13129
13155
  if (options === void 0) { options = {}; }
13130
- var _this = _super.call(this, options) || this;
13131
- _this.nodeName = exports.Shape.IMAGE;
13132
- return _this;
13156
+ return _super.call(this, tslib.__assign({ type: exports.Shape.IMAGE }, options)) || this;
13133
13157
  }
13134
13158
  return Image;
13135
13159
  }(DisplayObject));
@@ -13662,9 +13686,7 @@ var Rect = /** @class */ (function (_super) {
13662
13686
  tslib.__extends(Rect, _super);
13663
13687
  function Rect(options) {
13664
13688
  if (options === void 0) { options = {}; }
13665
- var _this = _super.call(this, options) || this;
13666
- _this.nodeName = exports.Shape.RECT;
13667
- return _this;
13689
+ return _super.call(this, tslib.__assign({ type: exports.Shape.RECT }, options)) || this;
13668
13690
  }
13669
13691
  return Rect;
13670
13692
  }(DisplayObject));
@@ -14711,6 +14733,7 @@ var PrepareRendererPlugin = /** @class */ (function () {
14711
14733
  }
14712
14734
  PrepareRendererPlugin.prototype.apply = function (context) {
14713
14735
  var _this = this;
14736
+ var _a;
14714
14737
  var renderingService = context.renderingService, renderingContext = context.renderingContext, rBushRoot = context.rBushRoot;
14715
14738
  var canvas = renderingContext.root.ownerDocument.defaultView;
14716
14739
  this.rBush = rBushRoot;
@@ -14769,11 +14792,12 @@ var PrepareRendererPlugin = /** @class */ (function () {
14769
14792
  canvas.removeEventListener(exports.ElementEvent.BOUNDS_CHANGED, handleBoundsChanged);
14770
14793
  _this.toSync.clear();
14771
14794
  });
14795
+ var ric = (_a = runtime.globalThis.requestIdleCallback) !== null && _a !== void 0 ? _a : raf.bind(runtime.globalThis);
14772
14796
  renderingService.hooks.endFrame.tap(PrepareRendererPlugin.tag, function () {
14773
14797
  if (_this.isFirstTimeRendering) {
14774
14798
  _this.isFirstTimeRendering = false;
14775
14799
  _this.syncing = true;
14776
- requestIdleCallback(function () {
14800
+ ric(function () {
14777
14801
  _this.syncRTree(true);
14778
14802
  });
14779
14803
  }