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

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
@@ -4241,10 +4241,10 @@ function mergeNumberLists(left, right) {
4241
4241
  }
4242
4242
 
4243
4243
  function getOrCalculatePathTotalLength(path) {
4244
- if (path.parsedStyle.path.totalLength === 0) {
4245
- path.parsedStyle.path.totalLength = util.getTotalLength(path.parsedStyle.path.absolutePath);
4244
+ if (path.parsedStyle.d.totalLength === 0) {
4245
+ path.parsedStyle.d.totalLength = util.getTotalLength(path.parsedStyle.d.absolutePath);
4246
4246
  }
4247
- return path.parsedStyle.path.totalLength;
4247
+ return path.parsedStyle.d.totalLength;
4248
4248
  }
4249
4249
  function removeRedundantMCommand(path) {
4250
4250
  for (var i = 0; i < path.length; i++) {
@@ -4954,7 +4954,7 @@ function convertToPath(object, transform) {
4954
4954
  }));
4955
4955
  break;
4956
4956
  case exports.Shape.PATH:
4957
- var absolutePath = object.parsedStyle.path.absolutePath;
4957
+ var absolutePath = object.parsedStyle.d.absolutePath;
4958
4958
  commands = tslib.__spreadArray([], tslib.__read(absolutePath), false);
4959
4959
  break;
4960
4960
  }
@@ -6394,11 +6394,10 @@ var BUILT_IN_PROPERTIES = [
6394
6394
  },
6395
6395
  // Path
6396
6396
  {
6397
- n: 'path',
6397
+ n: 'd',
6398
6398
  int: true,
6399
6399
  l: true,
6400
6400
  d: '',
6401
- a: ['d'],
6402
6401
  syntax: exports.PropertySyntax.PATH,
6403
6402
  p: 50,
6404
6403
  },
@@ -6565,7 +6564,7 @@ var BUILT_IN_PROPERTIES = [
6565
6564
  d: '0',
6566
6565
  },
6567
6566
  ];
6568
- BUILT_IN_PROPERTIES.filter(function (n) { return !!n.l; }).map(function (n) { return n.n; });
6567
+ var GEOMETRY_ATTRIBUTE_NAMES = BUILT_IN_PROPERTIES.filter(function (n) { return !!n.l; }).map(function (n) { return n.n; });
6569
6568
  var propertyMetadataCache = {};
6570
6569
  var unresolvedProperties = new WeakMap();
6571
6570
  // const uniqueAttributeSet = new Set<string>();
@@ -6628,14 +6627,14 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6628
6627
  var oldOffsetPath = object.parsedStyle.offsetPath;
6629
6628
  object.parsedStyle = Object.assign(object.parsedStyle, attributes);
6630
6629
  var needUpdateGeometry = !!options.forceUpdateGeometry;
6631
- // if (!needUpdateGeometry) {
6632
- // for (let i = 0; i < GEOMETRY_ATTRIBUTE_NAMES.length; i++) {
6633
- // if (GEOMETRY_ATTRIBUTE_NAMES[i] in attributes) {
6634
- // needUpdateGeometry = true;
6635
- // break;
6636
- // }
6637
- // }
6638
- // }
6630
+ if (!needUpdateGeometry) {
6631
+ for (var i = 0; i < GEOMETRY_ATTRIBUTE_NAMES.length; i++) {
6632
+ if (GEOMETRY_ATTRIBUTE_NAMES[i] in attributes) {
6633
+ needUpdateGeometry = true;
6634
+ break;
6635
+ }
6636
+ }
6637
+ }
6639
6638
  if (attributes.fill) {
6640
6639
  object.parsedStyle.fill = parseColor(attributes.fill);
6641
6640
  }
@@ -6667,14 +6666,14 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6667
6666
  }
6668
6667
  // Path
6669
6668
  // @ts-ignore
6670
- if (attributes.path === '') {
6671
- object.parsedStyle.path = tslib.__assign({}, EMPTY_PARSED_PATH);
6669
+ if (attributes.d === '') {
6670
+ object.parsedStyle.d = tslib.__assign({}, EMPTY_PARSED_PATH);
6672
6671
  }
6673
6672
  // @ts-ignore
6674
- if (attributes.path) {
6675
- object.parsedStyle.path = parsePath(
6673
+ if (attributes.d) {
6674
+ object.parsedStyle.d = parsePath(
6676
6675
  // @ts-ignore
6677
- attributes.path);
6676
+ attributes.d);
6678
6677
  }
6679
6678
  // Text
6680
6679
  if (attributes.textTransform) {
@@ -6726,10 +6725,13 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6726
6725
  if (attributes.transform) {
6727
6726
  this.runtime.CSSPropertySyntaxFactory['<transform>'].postProcessor(object, attributeNames);
6728
6727
  }
6728
+ if (attributes.transformOrigin) {
6729
+ this.runtime.CSSPropertySyntaxFactory['<transform-origin>'].postProcessor(object, attributeNames);
6730
+ }
6729
6731
  if (needUpdateGeometry) {
6730
6732
  object.geometry.dirty = true;
6731
- // FIXME setOrigin may have already dirtified to root.
6732
- // this.runtime.sceneGraphService.dirtifyToRoot(object);
6733
+ object.renderable.boundsDirty = true;
6734
+ object.renderable.renderBoundsDirty = true;
6733
6735
  }
6734
6736
  }
6735
6737
  else {
@@ -6789,8 +6791,8 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6789
6791
  // update geometry
6790
6792
  if (needUpdateGeometry_1) {
6791
6793
  object.geometry.dirty = true;
6792
- // FIXME setOrigin may have already dirtified to root.
6793
- this.runtime.sceneGraphService.dirtifyToRoot(object);
6794
+ object.renderable.boundsDirty = true;
6795
+ object.renderable.renderBoundsDirty = true;
6794
6796
  }
6795
6797
  attributeNames_1.forEach(function (name) {
6796
6798
  if (name in object.parsedStyle) {
@@ -7002,11 +7004,15 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
7002
7004
  // depth / 2,
7003
7005
  // );
7004
7006
  // anchor is center by default, don't account for lineWidth here
7005
- var _h = parsedStyle, stroke = _h.stroke, lineWidth = _h.lineWidth,
7007
+ var _h = parsedStyle, stroke = _h.stroke, _j = _h.lineWidth, lineWidth = _j === void 0 ? 1 : _j,
7008
+ // lineCap,
7009
+ // lineJoin,
7010
+ // miterLimit,
7011
+ _k = _h.increasedLineWidthForHitTesting,
7006
7012
  // lineCap,
7007
7013
  // lineJoin,
7008
7014
  // miterLimit,
7009
- increasedLineWidthForHitTesting = _h.increasedLineWidthForHitTesting, shadowType = _h.shadowType, shadowColor = _h.shadowColor, _j = _h.filter, filter = _j === void 0 ? [] : _j, transformOrigin = _h.transformOrigin;
7015
+ increasedLineWidthForHitTesting = _k === void 0 ? 0 : _k, shadowType = _h.shadowType, shadowColor = _h.shadowColor, _l = _h.filter, filter = _l === void 0 ? [] : _l, transformOrigin = _h.transformOrigin;
7010
7016
  var center = [cx, cy, cz];
7011
7017
  // update geometry's AABB
7012
7018
  geometry_1.contentBounds.update(center, halfExtents);
@@ -7040,8 +7046,8 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
7040
7046
  geometry_1.renderBounds.update(center, halfExtents);
7041
7047
  // account for shadow, only support constant value now
7042
7048
  if (shadowColor && shadowType && shadowType !== 'inner') {
7043
- var _k = geometry_1.renderBounds, min = _k.min, max = _k.max;
7044
- var _l = parsedStyle, shadowBlur = _l.shadowBlur, shadowOffsetX = _l.shadowOffsetX, shadowOffsetY = _l.shadowOffsetY;
7049
+ var _m = geometry_1.renderBounds, min = _m.min, max = _m.max;
7050
+ var _o = parsedStyle, shadowBlur = _o.shadowBlur, shadowOffsetX = _o.shadowOffsetX, shadowOffsetY = _o.shadowOffsetY;
7045
7051
  var shadowBlurInPixels = shadowBlur || 0;
7046
7052
  var shadowOffsetXInPixels = shadowOffsetX || 0;
7047
7053
  var shadowOffsetYInPixels = shadowOffsetY || 0;
@@ -7412,6 +7418,7 @@ var CSSPropertyPath = /** @class */ (function () {
7412
7418
  rect: new Rectangle(0, 0, 0, 0),
7413
7419
  };
7414
7420
  }
7421
+ console.log('parsed', parsed);
7415
7422
  return parsed;
7416
7423
  };
7417
7424
  return CSSPropertyPath;
@@ -7811,7 +7818,7 @@ var genericFontFamilies = [
7811
7818
  ];
7812
7819
  var stringRegExp = /([\"\'])[^\'\"]+\1/;
7813
7820
  function toFontString(attributes) {
7814
- var fontSize = attributes.fontSize, fontFamily = attributes.fontFamily, fontStyle = attributes.fontStyle, fontVariant = attributes.fontVariant, fontWeight = attributes.fontWeight;
7821
+ var _a = attributes.fontSize, fontSize = _a === void 0 ? 16 : _a, _b = attributes.fontFamily, fontFamily = _b === void 0 ? 'sans-serif' : _b, _c = attributes.fontStyle, fontStyle = _c === void 0 ? 'normal' : _c, _d = attributes.fontVariant, fontVariant = _d === void 0 ? 'normal' : _d, _e = attributes.fontWeight, fontWeight = _e === void 0 ? 'normal' : _e;
7815
7822
  // build canvas api font setting from individual components. Convert a numeric this.fontSize to px
7816
7823
  // const fontSizeString: string = isNumber(fontSize) ? `${fontSize}px` : fontSize.toString();
7817
7824
  var fontSizeString = (util.isNumber(fontSize) && "".concat(fontSize, "px")) || '16px';
@@ -8107,8 +8114,8 @@ var PathUpdater = /** @class */ (function () {
8107
8114
  function PathUpdater() {
8108
8115
  }
8109
8116
  PathUpdater.prototype.update = function (parsedStyle) {
8110
- var path = parsedStyle.path;
8111
- var _a = path.rect, x = _a.x, y = _a.y, width = _a.width, height = _a.height;
8117
+ var d = parsedStyle.d;
8118
+ var _a = d.rect, x = _a.x, y = _a.y, width = _a.width, height = _a.height;
8112
8119
  var hwidth = width / 2;
8113
8120
  var hheight = height / 2;
8114
8121
  return {
@@ -8157,17 +8164,17 @@ var RectUpdater = /** @class */ (function () {
8157
8164
  function RectUpdater() {
8158
8165
  }
8159
8166
  RectUpdater.prototype.update = function (parsedStyle, object) {
8160
- var _a = parsedStyle.x, x = _a === void 0 ? 0 : _a, _b = parsedStyle.y, y = _b === void 0 ? 0 : _b, img = parsedStyle.img, _c = parsedStyle.width, width = _c === void 0 ? 0 : _c, _d = parsedStyle.height, height = _d === void 0 ? 0 : _d;
8167
+ var _a = parsedStyle.x, x = _a === void 0 ? 0 : _a, _b = parsedStyle.y, y = _b === void 0 ? 0 : _b, src = parsedStyle.src, _c = parsedStyle.width, width = _c === void 0 ? 0 : _c, _d = parsedStyle.height, height = _d === void 0 ? 0 : _d;
8161
8168
  var contentWidth = width;
8162
8169
  var contentHeight = height;
8163
8170
  // resize with HTMLImageElement's size
8164
- if (img && !util.isString(img)) {
8171
+ if (src && !util.isString(src)) {
8165
8172
  if (!contentWidth) {
8166
- contentWidth = img.width;
8173
+ contentWidth = src.width;
8167
8174
  parsedStyle.width = contentWidth;
8168
8175
  }
8169
8176
  if (!contentHeight) {
8170
- contentHeight = img.height;
8177
+ contentHeight = src.height;
8171
8178
  parsedStyle.height = contentHeight;
8172
8179
  }
8173
8180
  }
@@ -8187,18 +8194,20 @@ var TextUpdater = /** @class */ (function () {
8187
8194
  }
8188
8195
  TextUpdater.prototype.isReadyToMeasure = function (parsedStyle, object) {
8189
8196
  var text = parsedStyle.text, textAlign = parsedStyle.textAlign, textBaseline = parsedStyle.textBaseline, fontSize = parsedStyle.fontSize, fontStyle = parsedStyle.fontStyle, fontWeight = parsedStyle.fontWeight, fontVariant = parsedStyle.fontVariant, lineWidth = parsedStyle.lineWidth;
8190
- return (text &&
8191
- fontSize &&
8192
- fontStyle &&
8193
- fontWeight &&
8194
- fontVariant &&
8195
- textAlign &&
8196
- textBaseline &&
8197
- !util.isNil(lineWidth));
8197
+ return runtime.enableCSSParsing
8198
+ ? text &&
8199
+ fontSize &&
8200
+ fontStyle &&
8201
+ fontWeight &&
8202
+ fontVariant &&
8203
+ textAlign &&
8204
+ textBaseline &&
8205
+ !util.isNil(lineWidth)
8206
+ : text;
8198
8207
  };
8199
8208
  TextUpdater.prototype.update = function (parsedStyle, object) {
8200
8209
  var _a, _b;
8201
- var text = parsedStyle.text, textAlign = parsedStyle.textAlign, lineWidth = parsedStyle.lineWidth, textBaseline = parsedStyle.textBaseline, dx = parsedStyle.dx, dy = parsedStyle.dy, _c = parsedStyle.x, x = _c === void 0 ? 0 : _c, _d = parsedStyle.y, y = _d === void 0 ? 0 : _d;
8210
+ var text = parsedStyle.text, _c = parsedStyle.textAlign, textAlign = _c === void 0 ? 'start' : _c, _d = parsedStyle.lineWidth, lineWidth = _d === void 0 ? 1 : _d, _e = parsedStyle.textBaseline, textBaseline = _e === void 0 ? 'alphabetic' : _e, _f = parsedStyle.dx, dx = _f === void 0 ? 0 : _f, _g = parsedStyle.dy, dy = _g === void 0 ? 0 : _g, _h = parsedStyle.x, x = _h === void 0 ? 0 : _h, _j = parsedStyle.y, y = _j === void 0 ? 0 : _j;
8202
8211
  if (!this.isReadyToMeasure(parsedStyle, object)) {
8203
8212
  parsedStyle.metrics = {
8204
8213
  font: '',
@@ -11298,13 +11307,13 @@ var TextService = /** @class */ (function () {
11298
11307
  return properties;
11299
11308
  };
11300
11309
  TextService.prototype.measureText = function (text, parsedStyle, offscreenCanvas) {
11301
- var fontSize = parsedStyle.fontSize, wordWrap = parsedStyle.wordWrap, strokeHeight = parsedStyle.lineHeight, lineWidth = parsedStyle.lineWidth, textBaseline = parsedStyle.textBaseline, textAlign = parsedStyle.textAlign, letterSpacing = parsedStyle.letterSpacing, textPath = parsedStyle.textPath; parsedStyle.textPathSide; parsedStyle.textPathStartOffset;
11310
+ var _a = parsedStyle.fontSize, fontSize = _a === void 0 ? 16 : _a, _b = parsedStyle.wordWrap, wordWrap = _b === void 0 ? false : _b, strokeHeight = parsedStyle.lineHeight, _c = parsedStyle.lineWidth, lineWidth = _c === void 0 ? 1 : _c, _d = parsedStyle.textBaseline, textBaseline = _d === void 0 ? 'alphabetic' : _d, _e = parsedStyle.textAlign, textAlign = _e === void 0 ? 'start' : _e, _f = parsedStyle.letterSpacing, letterSpacing = _f === void 0 ? 0 : _f, textPath = parsedStyle.textPath; parsedStyle.textPathSide; parsedStyle.textPathStartOffset;
11302
11311
  var // dropShadow = 0,
11303
11312
  // dropShadowDistance = 0,
11304
- _a = parsedStyle.leading,
11313
+ _g = parsedStyle.leading,
11305
11314
  // dropShadow = 0,
11306
11315
  // dropShadowDistance = 0,
11307
- leading = _a === void 0 ? 0 : _a;
11316
+ leading = _g === void 0 ? 0 : _g;
11308
11317
  var font = toFontString(parsedStyle);
11309
11318
  // if (runtime.enableCSSParsing) {
11310
11319
  var fontProperties = this.measureFont(font, offscreenCanvas);
@@ -11416,7 +11425,7 @@ var TextService = /** @class */ (function () {
11416
11425
  TextService.prototype.setGraphemeOnPath = function () { };
11417
11426
  TextService.prototype.wordWrap = function (text, parsedStyle, offscreenCanvas) {
11418
11427
  var _this = this;
11419
- var _a = parsedStyle.wordWrapWidth, wordWrapWidth = _a === void 0 ? 0 : _a, letterSpacing = parsedStyle.letterSpacing, _b = parsedStyle.maxLines, maxLines = _b === void 0 ? Infinity : _b, textOverflow = parsedStyle.textOverflow;
11428
+ var _a = parsedStyle.wordWrapWidth, wordWrapWidth = _a === void 0 ? 0 : _a, _b = parsedStyle.letterSpacing, letterSpacing = _b === void 0 ? 0 : _b, _c = parsedStyle.maxLines, maxLines = _c === void 0 ? Infinity : _c, textOverflow = parsedStyle.textOverflow;
11420
11429
  var context = this.runtime.offscreenCanvasCreator.getOrCreateContext(offscreenCanvas);
11421
11430
  var maxWidth = wordWrapWidth + letterSpacing;
11422
11431
  var ellipsis = '';
@@ -12275,20 +12284,7 @@ var DEFAULT_PARSED_STYLE_PROPS = {
12275
12284
  shadowType: 'outer',
12276
12285
  miterLimit: 10,
12277
12286
  };
12278
- // const DEFAULT_PARSED_STYLE_PROPS_CSS_DISABLED = {
12279
- // ...DEFAULT_PARSED_STYLE_PROPS,
12280
- // opacity: 1,
12281
- // fillOpacity: 1,
12282
- // strokeOpacity: 1,
12283
- // visibility: 'visible',
12284
- // pointerEvents: 'auto',
12285
- // lineWidth: 1,
12286
- // lineCap: 'butt',
12287
- // lineJoin: 'miter',
12288
- // increasedLineWidthForHitTesting: 0,
12289
- // fillRule: 'nonzero',
12290
- // // TODO: transformOrigin
12291
- // };
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' });
12292
12288
  var INHERITABLE_BASE_STYLE_PROPS = [
12293
12289
  'opacity',
12294
12290
  'fillOpacity',
@@ -12354,6 +12350,11 @@ var DisplayObject = /** @class */ (function (_super) {
12354
12350
  Object.assign(_this.attributes, DEFAULT_STYLE_PROPS);
12355
12351
  Object.assign(_this.parsedStyle, DEFAULT_PARSED_STYLE_PROPS, _this.config.initialParsedStyle);
12356
12352
  }
12353
+ else if (_this.config.initialParsedStyle) {
12354
+ Object.assign(_this.parsedStyle,
12355
+ // DEFAULT_PARSED_STYLE_PROPS_CSS_DISABLED,
12356
+ _this.config.initialParsedStyle);
12357
+ }
12357
12358
  // start to process attributes
12358
12359
  _this.initAttributes(_this.config.style);
12359
12360
  if (runtime.enableDataset) {
@@ -13257,11 +13258,11 @@ var Path = /** @class */ (function (_super) {
13257
13258
  var _this = this;
13258
13259
  var style = _a.style, rest = tslib.__rest(_a, ["style"]);
13259
13260
  _this = _super.call(this, tslib.__assign({ type: exports.Shape.PATH, style: runtime.enableCSSParsing
13260
- ? tslib.__assign({ path: '', miterLimit: '' }, style) : tslib.__assign({}, style), initialParsedStyle: runtime.enableCSSParsing
13261
+ ? tslib.__assign({ d: '', miterLimit: '' }, style) : tslib.__assign({}, style), initialParsedStyle: runtime.enableCSSParsing
13261
13262
  ? null
13262
13263
  : {
13263
13264
  miterLimit: 4,
13264
- path: tslib.__assign({}, EMPTY_PARSED_PATH),
13265
+ d: tslib.__assign({}, EMPTY_PARSED_PATH),
13265
13266
  } }, rest)) || this;
13266
13267
  _this.markerStartAngle = 0;
13267
13268
  _this.markerEndAngle = 0;
@@ -13286,7 +13287,7 @@ var Path = /** @class */ (function (_super) {
13286
13287
  return _this;
13287
13288
  }
13288
13289
  Path.prototype.attributeChangedCallback = function (attrName, oldValue, newValue, prevParsedValue, newParsedValue) {
13289
- if (attrName === 'path') {
13290
+ if (attrName === 'd') {
13290
13291
  // recalc markers
13291
13292
  this.transformMarker(true);
13292
13293
  this.transformMarker(false);
@@ -13361,7 +13362,7 @@ var Path = /** @class */ (function (_super) {
13361
13362
  marker.setLocalPosition(ox + Math.cos(rad) * offset, oy + Math.sin(rad) * offset);
13362
13363
  };
13363
13364
  Path.prototype.placeMarkerMid = function (marker) {
13364
- var segments = this.parsedStyle.path.segments;
13365
+ var segments = this.parsedStyle.d.segments;
13365
13366
  // clear all existed markers
13366
13367
  this.markerMidList.forEach(function (marker) {
13367
13368
  marker.remove();
@@ -13390,7 +13391,7 @@ var Path = /** @class */ (function (_super) {
13390
13391
  */
13391
13392
  Path.prototype.getPointAtLength = function (distance, inWorldSpace) {
13392
13393
  if (inWorldSpace === void 0) { inWorldSpace = false; }
13393
- var absolutePath = this.parsedStyle.path.absolutePath;
13394
+ var absolutePath = this.parsedStyle.d.absolutePath;
13394
13395
  var _a = util.getPointAtLength(absolutePath, distance), x = _a.x, y = _a.y;
13395
13396
  var transformed = glMatrix.vec3.transformMat4(glMatrix.vec3.create(), glMatrix.vec3.fromValues(x, y, 0), inWorldSpace ? this.getWorldTransform() : this.getLocalTransform());
13396
13397
  // apply local transformation
@@ -13407,7 +13408,7 @@ var Path = /** @class */ (function (_super) {
13407
13408
  * Get start tangent vector
13408
13409
  */
13409
13410
  Path.prototype.getStartTangent = function () {
13410
- var segments = this.parsedStyle.path.segments;
13411
+ var segments = this.parsedStyle.d.segments;
13411
13412
  var result = [];
13412
13413
  if (segments.length > 1) {
13413
13414
  var startPoint = segments[0].currentPoint;
@@ -13429,7 +13430,7 @@ var Path = /** @class */ (function (_super) {
13429
13430
  * Get end tangent vector
13430
13431
  */
13431
13432
  Path.prototype.getEndTangent = function () {
13432
- var segments = this.parsedStyle.path.segments;
13433
+ var segments = this.parsedStyle.d.segments;
13433
13434
  var length = segments.length;
13434
13435
  var result = [];
13435
13436
  if (length > 1) {
@@ -13685,26 +13686,7 @@ var Text = /** @class */ (function (_super) {
13685
13686
  return _super.call(this, tslib.__assign({ type: exports.Shape.TEXT, style: runtime.enableCSSParsing
13686
13687
  ? tslib.__assign({ x: '', y: '', text: '', fontSize: '', fontFamily: '', fontStyle: '', fontWeight: '', fontVariant: '', textAlign: '', textBaseline: '', textTransform: '', fill: 'black', letterSpacing: '', lineHeight: '', miterLimit: '',
13687
13688
  // whiteSpace: 'pre',
13688
- wordWrap: false, wordWrapWidth: 0, leading: 0, dx: '', dy: '' }, style) : tslib.__assign({ fill: 'black' }, style), initialParsedStyle: runtime.enableCSSParsing
13689
- ? {}
13690
- : {
13691
- x: 0,
13692
- y: 0,
13693
- fontSize: 16,
13694
- fontFamily: 'sans-serif',
13695
- fontStyle: 'normal',
13696
- fontWeight: 'normal',
13697
- fontVariant: 'normal',
13698
- lineHeight: 0,
13699
- letterSpacing: 0,
13700
- textBaseline: 'alphabetic',
13701
- textAlign: 'start',
13702
- wordWrap: false,
13703
- wordWrapWidth: 0,
13704
- leading: 0,
13705
- dx: 0,
13706
- dy: 0,
13707
- } }, rest)) || this;
13689
+ wordWrap: false, wordWrapWidth: 0, leading: 0, dx: '', dy: '' }, style) : tslib.__assign({ fill: 'black' }, style) }, rest)) || this;
13708
13690
  }
13709
13691
  // lengthAdjust: SVGAnimatedEnumeration;
13710
13692
  // textLength: SVGAnimatedLength;
@@ -14724,7 +14706,7 @@ var PrepareRendererPlugin = /** @class */ (function () {
14724
14706
  * sync to RBush later
14725
14707
  */
14726
14708
  this.toSync = new Set();
14727
- // private isFirstTimeRendering = true;
14709
+ this.isFirstTimeRendering = true;
14728
14710
  this.syncing = false;
14729
14711
  }
14730
14712
  PrepareRendererPlugin.prototype.apply = function (context) {
@@ -14788,14 +14770,22 @@ var PrepareRendererPlugin = /** @class */ (function () {
14788
14770
  _this.toSync.clear();
14789
14771
  });
14790
14772
  renderingService.hooks.endFrame.tap(PrepareRendererPlugin.tag, function () {
14791
- requestIdleCallback(function () {
14773
+ if (_this.isFirstTimeRendering) {
14774
+ _this.isFirstTimeRendering = false;
14775
+ _this.syncing = true;
14776
+ requestIdleCallback(function () {
14777
+ _this.syncRTree(true);
14778
+ });
14779
+ }
14780
+ else {
14792
14781
  _this.syncRTree();
14793
- });
14782
+ }
14794
14783
  });
14795
14784
  };
14796
- PrepareRendererPlugin.prototype.syncRTree = function () {
14785
+ PrepareRendererPlugin.prototype.syncRTree = function (force) {
14797
14786
  var _this = this;
14798
- if (this.syncing || this.toSync.size === 0) {
14787
+ if (force === void 0) { force = false; }
14788
+ if (!force && (this.syncing || this.toSync.size === 0)) {
14799
14789
  return;
14800
14790
  }
14801
14791
  this.syncing = true;