@visactor/vrender 0.14.1 → 0.14.3

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
@@ -3649,7 +3649,7 @@
3649
3649
  return Array.isArray(object) && object.some(isPromise);
3650
3650
  }
3651
3651
 
3652
- var __awaiter$3 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
3652
+ var __awaiter$4 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
3653
3653
  function adopt(value) {
3654
3654
  return value instanceof P ? value : new P(function (resolve) {
3655
3655
  resolve(value);
@@ -3794,7 +3794,7 @@
3794
3794
  }
3795
3795
  };
3796
3796
  var _saveAsyncResultToSingletonScope = function _saveAsyncResultToSingletonScope(binding, asyncResult) {
3797
- return __awaiter$3(void 0, void 0, void 0, function () {
3797
+ return __awaiter$4(void 0, void 0, void 0, function () {
3798
3798
  var result, ex_1;
3799
3799
  return __generator$3(this, function (_a) {
3800
3800
  switch (_a.label) {
@@ -3882,7 +3882,7 @@
3882
3882
  };
3883
3883
  return __assign$1.apply(this, arguments);
3884
3884
  };
3885
- var __awaiter$2 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
3885
+ var __awaiter$3 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
3886
3886
  function adopt(value) {
3887
3887
  return value instanceof P ? value : new P(function (resolve) {
3888
3888
  resolve(value);
@@ -4055,7 +4055,7 @@
4055
4055
  return instance;
4056
4056
  }
4057
4057
  function createInstanceWithInjectionsAsync(args) {
4058
- return __awaiter$2(this, void 0, void 0, function () {
4058
+ return __awaiter$3(this, void 0, void 0, function () {
4059
4059
  var constructorInjections, propertyInjections;
4060
4060
  return __generator$2(this, function (_a) {
4061
4061
  switch (_a.label) {
@@ -4075,7 +4075,7 @@
4075
4075
  });
4076
4076
  }
4077
4077
  function possiblyWaitInjections(possiblePromiseinjections) {
4078
- return __awaiter$2(this, void 0, void 0, function () {
4078
+ return __awaiter$3(this, void 0, void 0, function () {
4079
4079
  var injections, _i, possiblePromiseinjections_1, injection;
4080
4080
  return __generator$2(this, function (_a) {
4081
4081
  injections = [];
@@ -4138,7 +4138,7 @@
4138
4138
  }
4139
4139
  }
4140
4140
 
4141
- var __awaiter$1 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4141
+ var __awaiter$2 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4142
4142
  function adopt(value) {
4143
4143
  return value instanceof P ? value : new P(function (resolve) {
4144
4144
  resolve(value);
@@ -4364,7 +4364,7 @@
4364
4364
  return result;
4365
4365
  };
4366
4366
  var _activateContainerAsync = function _activateContainerAsync(activationsIterator, context, resultPromise) {
4367
- return __awaiter$1(void 0, void 0, void 0, function () {
4367
+ return __awaiter$2(void 0, void 0, void 0, function () {
4368
4368
  var result, activation;
4369
4369
  return __generator$1(this, function (_a) {
4370
4370
  switch (_a.label) {
@@ -4978,7 +4978,7 @@
4978
4978
  };
4979
4979
  return __assign.apply(this, arguments);
4980
4980
  };
4981
- var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4981
+ var __awaiter$1 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4982
4982
  function adopt(value) {
4983
4983
  return value instanceof P ? value : new P(function (resolve) {
4984
4984
  resolve(value);
@@ -5177,7 +5177,7 @@
5177
5177
  for (var _i = 0; _i < arguments.length; _i++) {
5178
5178
  modules[_i] = arguments[_i];
5179
5179
  }
5180
- return __awaiter(this, void 0, void 0, function () {
5180
+ return __awaiter$1(this, void 0, void 0, function () {
5181
5181
  var getHelpers, _a, modules_2, currentModule, containerModuleHelpers;
5182
5182
  return __generator(this, function (_b) {
5183
5183
  switch (_b.label) {
@@ -5219,7 +5219,7 @@
5219
5219
  for (var _i = 0; _i < arguments.length; _i++) {
5220
5220
  modules[_i] = arguments[_i];
5221
5221
  }
5222
- return __awaiter(this, void 0, void 0, function () {
5222
+ return __awaiter$1(this, void 0, void 0, function () {
5223
5223
  var _a, modules_3, module_1, deactivations;
5224
5224
  return __generator(this, function (_b) {
5225
5225
  switch (_b.label) {
@@ -5255,7 +5255,7 @@
5255
5255
  return this.bind(serviceIdentifier);
5256
5256
  };
5257
5257
  Container.prototype.rebindAsync = function (serviceIdentifier) {
5258
- return __awaiter(this, void 0, void 0, function () {
5258
+ return __awaiter$1(this, void 0, void 0, function () {
5259
5259
  return __generator(this, function (_a) {
5260
5260
  switch (_a.label) {
5261
5261
  case 0:
@@ -5275,7 +5275,7 @@
5275
5275
  this._removeServiceFromDictionary(serviceIdentifier);
5276
5276
  };
5277
5277
  Container.prototype.unbindAsync = function (serviceIdentifier) {
5278
- return __awaiter(this, void 0, void 0, function () {
5278
+ return __awaiter$1(this, void 0, void 0, function () {
5279
5279
  var bindings;
5280
5280
  return __generator(this, function (_a) {
5281
5281
  switch (_a.label) {
@@ -5301,7 +5301,7 @@
5301
5301
  this._bindingDictionary = new Lookup();
5302
5302
  };
5303
5303
  Container.prototype.unbindAllAsync = function () {
5304
- return __awaiter(this, void 0, void 0, function () {
5304
+ return __awaiter$1(this, void 0, void 0, function () {
5305
5305
  var promises;
5306
5306
  var _this = this;
5307
5307
  return __generator(this, function (_a) {
@@ -5390,7 +5390,7 @@
5390
5390
  return this._getButThrowIfAsync(getArgs);
5391
5391
  };
5392
5392
  Container.prototype.getAsync = function (serviceIdentifier) {
5393
- return __awaiter(this, void 0, void 0, function () {
5393
+ return __awaiter$1(this, void 0, void 0, function () {
5394
5394
  var getArgs;
5395
5395
  return __generator(this, function (_a) {
5396
5396
  getArgs = this._getNotAllArgs(serviceIdentifier, false);
@@ -5403,7 +5403,7 @@
5403
5403
  return this._getButThrowIfAsync(getArgs);
5404
5404
  };
5405
5405
  Container.prototype.getTaggedAsync = function (serviceIdentifier, key, value) {
5406
- return __awaiter(this, void 0, void 0, function () {
5406
+ return __awaiter$1(this, void 0, void 0, function () {
5407
5407
  var getArgs;
5408
5408
  return __generator(this, function (_a) {
5409
5409
  getArgs = this._getNotAllArgs(serviceIdentifier, false, key, value);
@@ -5487,7 +5487,7 @@
5487
5487
  }
5488
5488
  };
5489
5489
  Container.prototype._handleDeactivationError = function (asyncResult, constructor) {
5490
- return __awaiter(this, void 0, void 0, function () {
5490
+ return __awaiter$1(this, void 0, void 0, function () {
5491
5491
  var ex_1;
5492
5492
  return __generator(this, function (_a) {
5493
5493
  switch (_a.label) {
@@ -5520,7 +5520,7 @@
5520
5520
  }
5521
5521
  };
5522
5522
  Container.prototype._deactivateContainerAsync = function (instance, deactivationsIterator) {
5523
- return __awaiter(this, void 0, void 0, function () {
5523
+ return __awaiter$1(this, void 0, void 0, function () {
5524
5524
  var deactivation;
5525
5525
  return __generator(this, function (_a) {
5526
5526
  switch (_a.label) {
@@ -5673,7 +5673,7 @@
5673
5673
  }
5674
5674
  };
5675
5675
  Container.prototype._deactivateSingletonsAsync = function (bindings) {
5676
- return __awaiter(this, void 0, void 0, function () {
5676
+ return __awaiter$1(this, void 0, void 0, function () {
5677
5677
  var _this = this;
5678
5678
  return __generator(this, function (_a) {
5679
5679
  switch (_a.label) {
@@ -5696,7 +5696,7 @@
5696
5696
  }
5697
5697
  };
5698
5698
  Container.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync = function (binding, instance, constructor) {
5699
- return __awaiter(this, void 0, void 0, function () {
5699
+ return __awaiter$1(this, void 0, void 0, function () {
5700
5700
  return __generator(this, function (_a) {
5701
5701
  switch (_a.label) {
5702
5702
  case 0:
@@ -5736,7 +5736,7 @@
5736
5736
  return this._preDestroy(constructor, instance);
5737
5737
  };
5738
5738
  Container.prototype._bindingDeactivationAndPreDestroyAsync = function (binding, instance, constructor) {
5739
- return __awaiter(this, void 0, void 0, function () {
5739
+ return __awaiter$1(this, void 0, void 0, function () {
5740
5740
  return __generator(this, function (_a) {
5741
5741
  switch (_a.label) {
5742
5742
  case 0:
@@ -5907,6 +5907,33 @@
5907
5907
  function __metadata(metadataKey, metadataValue) {
5908
5908
  if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
5909
5909
  }
5910
+ function __awaiter(thisArg, _arguments, P, generator) {
5911
+ function adopt(value) {
5912
+ return value instanceof P ? value : new P(function (resolve) {
5913
+ resolve(value);
5914
+ });
5915
+ }
5916
+ return new (P || (P = Promise))(function (resolve, reject) {
5917
+ function fulfilled(value) {
5918
+ try {
5919
+ step(generator.next(value));
5920
+ } catch (e) {
5921
+ reject(e);
5922
+ }
5923
+ }
5924
+ function rejected(value) {
5925
+ try {
5926
+ step(generator["throw"](value));
5927
+ } catch (e) {
5928
+ reject(e);
5929
+ }
5930
+ }
5931
+ function step(result) {
5932
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
5933
+ }
5934
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
5935
+ });
5936
+ }
5910
5937
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
5911
5938
  var e = new Error(message);
5912
5939
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
@@ -9206,11 +9233,7 @@
9206
9233
  strokeBoundsBuffer: 2,
9207
9234
  stroke: false
9208
9235
  };
9209
- const DefaultStrokeStyle = {
9210
- outerBorder: { ...commonStroke, distance: 0 },
9211
- innerBorder: { ...commonStroke, distance: 0 },
9212
- ...commonStroke
9213
- };
9236
+ const DefaultStrokeStyle = Object.assign({ outerBorder: Object.assign(Object.assign({}, commonStroke), { distance: 0 }), innerBorder: Object.assign(Object.assign({}, commonStroke), { distance: 0 }) }, commonStroke);
9214
9237
  const DefaultTextStyle = {
9215
9238
  text: '',
9216
9239
  maxLineWidth: Infinity,
@@ -9230,41 +9253,14 @@
9230
9253
  direction: 'horizontal',
9231
9254
  wordBreak: 'break-all'
9232
9255
  };
9233
- const DefaultStyle = {
9234
- opacity: 1,
9235
- background: null,
9236
- texture: null,
9237
- textureColor: 'black',
9238
- textureSize: 10,
9239
- texturePadding: 2,
9240
- backgroundMode: 0,
9241
- blur: 0,
9242
- cursor: null,
9243
- ...DefaultFillStyle,
9244
- ...DefaultStrokeStyle,
9245
- ...DefaultLayout
9246
- };
9256
+ const DefaultStyle = Object.assign(Object.assign(Object.assign({ opacity: 1, background: null, texture: null, textureColor: 'black', textureSize: 10, texturePadding: 2, backgroundMode: 0, blur: 0, cursor: null }, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout);
9247
9257
  const DefaultConnectAttribute = {
9248
9258
  connectedType: 'none',
9249
9259
  connectedStyle: {},
9250
9260
  connectedX: NaN,
9251
9261
  connectedY: NaN
9252
9262
  };
9253
- const DefaultAttribute = {
9254
- strokeSeg: null,
9255
- pickable: true,
9256
- childrenPickable: true,
9257
- visible: true,
9258
- zIndex: 0,
9259
- layout: null,
9260
- boundsPadding: 0,
9261
- pickMode: 'accurate',
9262
- customPickShape: null,
9263
- boundsMode: 'accurate',
9264
- keepDirIn3d: true,
9265
- ...DefaultStyle,
9266
- ...DefaultTransform
9267
- };
9263
+ const DefaultAttribute = Object.assign(Object.assign({ strokeSeg: null, pickable: true, childrenPickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true }, DefaultStyle), DefaultTransform);
9268
9264
  function addAttributeToPrototype(obj, c, keys) {
9269
9265
  keys.forEach(key => {
9270
9266
  c.prototype[key] = obj[key];
@@ -9273,145 +9269,23 @@
9273
9269
  function rewriteProto(obj, c) {
9274
9270
  Object.setPrototypeOf(obj, c);
9275
9271
  }
9276
- const DefaultArcAttribute = {
9277
- ...DefaultAttribute,
9278
- startAngle: 0,
9279
- endAngle: pi2,
9280
- innerRadius: 0,
9281
- outerRadius: 1,
9282
- cornerRadius: 0,
9283
- padRadius: 0,
9284
- padAngle: 0,
9285
- cap: false,
9286
- forceShowCap: false
9287
- };
9288
- const DefaultAreaAttribute = {
9289
- ...DefaultAttribute,
9290
- ...DefaultConnectAttribute,
9291
- points: [],
9292
- segments: [],
9293
- curveType: 'linear',
9294
- clipRange: 1
9295
- };
9296
- const DefaultCircleAttribute = {
9297
- ...DefaultAttribute,
9298
- radius: 1,
9299
- startAngle: 0,
9300
- endAngle: pi2
9301
- };
9302
- const DefaultGroupAttribute = {
9303
- ...DefaultAttribute,
9304
- width: 0,
9305
- height: 0,
9306
- cornerRadius: 0,
9307
- path: [],
9308
- clip: false,
9309
- visibleAll: true,
9310
- display: 'relative',
9311
- flexDirection: 'row',
9312
- flexWrap: 'wrap',
9313
- justifyContent: 'flex-start',
9314
- alignItems: 'flex-start',
9315
- alignContent: 'flex-start'
9316
- };
9317
- const DefaultGlyphAttribute = {
9318
- ...DefaultAttribute,
9319
- path: '',
9320
- width: 0,
9321
- height: 0,
9322
- cornerRadius: 0,
9323
- clip: false
9324
- };
9325
- const DefaultLineAttribute = {
9326
- ...DefaultAttribute,
9327
- ...DefaultConnectAttribute,
9328
- points: [],
9329
- segments: [],
9330
- curveType: 'linear',
9331
- clipRange: 1,
9332
- clipRangeByDimension: 'default'
9333
- };
9334
- const DefaultPathAttribute = {
9335
- ...DefaultAttribute,
9336
- path: new CustomPath2D(),
9337
- customPath: () => {
9272
+ const DefaultArcAttribute = Object.assign(Object.assign({}, DefaultAttribute), { startAngle: 0, endAngle: pi2, innerRadius: 0, outerRadius: 1, cornerRadius: 0, padRadius: 0, padAngle: 0, cap: false, forceShowCap: false });
9273
+ const DefaultAreaAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1 });
9274
+ const DefaultCircleAttribute = Object.assign(Object.assign({}, DefaultAttribute), { radius: 1, startAngle: 0, endAngle: pi2 });
9275
+ const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, cornerRadius: 0, path: [], clip: false, visibleAll: true, display: 'relative', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'flex-start', alignItems: 'flex-start', alignContent: 'flex-start' });
9276
+ const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: '', width: 0, height: 0, cornerRadius: 0, clip: false });
9277
+ const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, clipRangeByDimension: 'default' });
9278
+ const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: new CustomPath2D(), customPath: () => {
9338
9279
  console.warn('空函数');
9339
- }
9340
- };
9341
- const DefaultPolygonAttribute = {
9342
- ...DefaultAttribute,
9343
- points: [],
9344
- cornerRadius: 0
9345
- };
9346
- const DefaultRectAttribute = {
9347
- ...DefaultAttribute,
9348
- width: 0,
9349
- height: 0,
9350
- strokeBoundsBuffer: 0,
9351
- cornerRadius: 0
9352
- };
9353
- const DefaultRect3dAttribute = {
9354
- ...DefaultAttribute,
9355
- width: 0,
9356
- height: 0,
9357
- cornerRadius: 0,
9358
- length: 0
9359
- };
9360
- const DefaultSymbolAttribute = {
9361
- ...DefaultAttribute,
9362
- symbolType: 'circle',
9363
- size: 10,
9364
- keepDirIn3d: true
9365
- };
9366
- const DefaultTextAttribute = {
9367
- ...DefaultAttribute,
9368
- ...DefaultTextStyle,
9369
- strokeBoundsBuffer: 0,
9370
- keepDirIn3d: true
9371
- };
9372
- const DefaultRichTextAttribute = {
9373
- ...DefaultAttribute,
9374
- width: 300,
9375
- height: 300,
9376
- ellipsis: true,
9377
- wordBreak: 'break-word',
9378
- verticalDirection: 'top',
9379
- textAlign: 'left',
9380
- textBaseline: 'top',
9381
- layoutDirection: 'horizontal',
9382
- textConfig: [],
9383
- maxHeight: undefined,
9384
- maxWidth: undefined,
9385
- singleLine: false
9386
- };
9387
- const DefaultImageAttribute = {
9388
- repeatX: 'no-repeat',
9389
- repeatY: 'no-repeat',
9390
- image: '',
9391
- width: 0,
9392
- height: 0,
9393
- ...DefaultAttribute,
9394
- fill: true
9395
- };
9396
- const DefaultRichTextIconAttribute = {
9397
- ...DefaultImageAttribute,
9398
- backgroundShowMode: 'never',
9399
- backgroundWidth: 0,
9400
- backgroundHeight: 0,
9401
- textAlign: 'left',
9402
- textBaseline: 'middle',
9403
- direction: 'horizontal',
9404
- margin: 0,
9405
- id: '',
9406
- width: 20,
9407
- height: 20,
9408
- backgroundFill: 'rgba(101, 117, 168, 0.1)',
9409
- backgroundFillOpacity: 1,
9410
- backgroundStroke: false,
9411
- backgroundStrokeOpacity: 1,
9412
- backgroundRadius: 4,
9413
- opacity: 1
9414
- };
9280
+ } });
9281
+ const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute), { points: [], cornerRadius: 0 });
9282
+ const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, strokeBoundsBuffer: 0, cornerRadius: 0 });
9283
+ const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, cornerRadius: 0, length: 0 });
9284
+ const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), { symbolType: 'circle', size: 10, keepDirIn3d: true });
9285
+ const DefaultTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { strokeBoundsBuffer: 0, keepDirIn3d: true });
9286
+ const DefaultRichTextAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 300, height: 300, ellipsis: true, wordBreak: 'break-word', verticalDirection: 'top', textAlign: 'left', textBaseline: 'top', layoutDirection: 'horizontal', textConfig: [], maxHeight: undefined, maxWidth: undefined, singleLine: false });
9287
+ const DefaultImageAttribute = Object.assign(Object.assign({ repeatX: 'no-repeat', repeatY: 'no-repeat', image: '', width: 0, height: 0 }, DefaultAttribute), { fill: true });
9288
+ const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), { backgroundShowMode: 'never', backgroundWidth: 0, backgroundHeight: 0, textAlign: 'left', textBaseline: 'middle', direction: 'horizontal', margin: 0, id: '', width: 20, height: 20, backgroundFill: 'rgba(101, 117, 168, 0.1)', backgroundFillOpacity: 1, backgroundStroke: false, backgroundStrokeOpacity: 1, backgroundRadius: 4, opacity: 1 });
9415
9289
 
9416
9290
  class Application {
9417
9291
  }
@@ -9661,7 +9535,7 @@
9661
9535
  clipedData.width = this.measureTextWidth(clipedData.str, options);
9662
9536
  }
9663
9537
  }
9664
- out.push({ ...verticalList[i], text: clipedData.str, width: clipedData.width });
9538
+ out.push(Object.assign(Object.assign({}, verticalList[i]), { text: clipedData.str, width: clipedData.width }));
9665
9539
  length += clipedData.width;
9666
9540
  }
9667
9541
  return {
@@ -10546,16 +10420,10 @@
10546
10420
  }
10547
10421
  createTextMeasureInstance(textSpec, option, getCanvasForMeasure) {
10548
10422
  this.configure(this.global, this.global.env);
10549
- return new TextMeasure({
10550
- defaultFontParams: {
10423
+ return new TextMeasure(Object.assign({ defaultFontParams: {
10551
10424
  fontFamily: DefaultTextStyle.fontFamily,
10552
10425
  fontSize: DefaultTextStyle.fontSize
10553
- },
10554
- getCanvasForMeasure: getCanvasForMeasure || (() => this.canvas),
10555
- getTextBounds: undefined,
10556
- specialCharSet: '-/: .,@%\'"~' + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase(),
10557
- ...(option !== null && option !== void 0 ? option : {})
10558
- }, textSpec);
10426
+ }, getCanvasForMeasure: getCanvasForMeasure || (() => this.canvas), getTextBounds: undefined, specialCharSet: '-/: .,@%\'"~' + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase() }, (option !== null && option !== void 0 ? option : {})), textSpec);
10559
10427
  }
10560
10428
  };
10561
10429
  exports.DefaultGraphicUtil = __decorate([
@@ -10932,35 +10800,37 @@
10932
10800
  }
10933
10801
  }
10934
10802
  }
10935
- async forEachChildrenAsync(cb, reverse = false) {
10936
- if (reverse) {
10937
- let child = this._lastChild;
10938
- let i = 0;
10939
- while (child) {
10940
- let breakTag = cb(child, i++);
10941
- if (breakTag.then) {
10942
- breakTag = await breakTag;
10943
- }
10944
- if (breakTag) {
10945
- return;
10803
+ forEachChildrenAsync(cb, reverse = false) {
10804
+ return __awaiter(this, void 0, void 0, function* () {
10805
+ if (reverse) {
10806
+ let child = this._lastChild;
10807
+ let i = 0;
10808
+ while (child) {
10809
+ let breakTag = cb(child, i++);
10810
+ if (breakTag.then) {
10811
+ breakTag = yield breakTag;
10812
+ }
10813
+ if (breakTag) {
10814
+ return;
10815
+ }
10816
+ child = child._prev;
10946
10817
  }
10947
- child = child._prev;
10948
10818
  }
10949
- }
10950
- else {
10951
- let child = this._firstChild;
10952
- let i = 0;
10953
- while (child) {
10954
- let breakTag = cb(child, i++);
10955
- if (breakTag.then) {
10956
- breakTag = await breakTag;
10957
- }
10958
- if (breakTag) {
10959
- return;
10819
+ else {
10820
+ let child = this._firstChild;
10821
+ let i = 0;
10822
+ while (child) {
10823
+ let breakTag = cb(child, i++);
10824
+ if (breakTag.then) {
10825
+ breakTag = yield breakTag;
10826
+ }
10827
+ if (breakTag) {
10828
+ return;
10829
+ }
10830
+ child = child._next;
10960
10831
  }
10961
- child = child._next;
10962
10832
  }
10963
- }
10833
+ });
10964
10834
  }
10965
10835
  forEach(cb) {
10966
10836
  return this.forEachChildren(cb);
@@ -14651,16 +14521,7 @@
14651
14521
  var _a;
14652
14522
  const root = this.target.attachShadow();
14653
14523
  const height = this.target.AABBBounds.height();
14654
- const rect = application.graphicService.creator.rect({
14655
- height: height,
14656
- fill: '#bcdeff',
14657
- shadowBlur: 30,
14658
- shadowColor: '#bcdeff',
14659
- ...(_a = this.params) === null || _a === void 0 ? void 0 : _a.attribute,
14660
- x: 0,
14661
- y: 0,
14662
- width: 0
14663
- });
14524
+ const rect = application.graphicService.creator.rect(Object.assign(Object.assign({ height: height, fill: '#bcdeff', shadowBlur: 30, shadowColor: '#bcdeff' }, (_a = this.params) === null || _a === void 0 ? void 0 : _a.attribute), { x: 0, y: 0, width: 0 }));
14664
14525
  this.rect = rect;
14665
14526
  root.add(rect);
14666
14527
  }
@@ -16423,10 +16284,7 @@
16423
16284
  if (fromGradient !== toGradient) {
16424
16285
  const gradient = (fromGradient ? from : to);
16425
16286
  const pure = (fromGradient ? to : from);
16426
- const gradientFromPure = {
16427
- ...gradient,
16428
- stops: gradient.stops.map(v => ({ ...v, color: colorArrayToString(pure) }))
16429
- };
16287
+ const gradientFromPure = Object.assign(Object.assign({}, gradient), { stops: gradient.stops.map(v => (Object.assign(Object.assign({}, v), { color: colorArrayToString(pure) }))) });
16430
16288
  return fromGradient
16431
16289
  ? interpolateColor(gradient, gradientFromPure, ratio, alphaChannel, cb)
16432
16290
  : interpolateColor(gradientFromPure, gradient, ratio, alphaChannel, cb);
@@ -18012,31 +17870,33 @@
18012
17870
  function incrementalAddTo(group, graphic) {
18013
17871
  group.incrementalAppendChild(graphic);
18014
17872
  }
18015
- async function waitForAllSubLayers(stage) {
18016
- const promiseList = [];
18017
- const layers = stage.getChildren();
18018
- await new Promise(resolve => {
18019
- application.global.getRequestAnimationFrame()(() => {
18020
- resolve(null);
17873
+ function waitForAllSubLayers(stage) {
17874
+ return __awaiter(this, void 0, void 0, function* () {
17875
+ const promiseList = [];
17876
+ const layers = stage.getChildren();
17877
+ yield new Promise(resolve => {
17878
+ application.global.getRequestAnimationFrame()(() => {
17879
+ resolve(null);
17880
+ });
18021
17881
  });
18022
- });
18023
- layers.forEach(l => {
18024
- if (l.subLayers.size) {
18025
- l.subLayers.forEach(sl => {
18026
- if (sl.drawContribution && sl.drawContribution.hooks && sl.drawContribution.rendering) {
18027
- promiseList.push(new Promise(resolve => {
18028
- sl.drawContribution.hooks.completeDraw.tap('outWait', () => {
18029
- sl.drawContribution.hooks.completeDraw.taps = sl.drawContribution.hooks.completeDraw.taps.filter(i => {
18030
- return i.name !== 'outWait';
17882
+ layers.forEach(l => {
17883
+ if (l.subLayers.size) {
17884
+ l.subLayers.forEach(sl => {
17885
+ if (sl.drawContribution && sl.drawContribution.hooks && sl.drawContribution.rendering) {
17886
+ promiseList.push(new Promise(resolve => {
17887
+ sl.drawContribution.hooks.completeDraw.tap('outWait', () => {
17888
+ sl.drawContribution.hooks.completeDraw.taps = sl.drawContribution.hooks.completeDraw.taps.filter(i => {
17889
+ return i.name !== 'outWait';
17890
+ });
17891
+ resolve(null);
18031
17892
  });
18032
- resolve(null);
18033
- });
18034
- }));
18035
- }
18036
- });
18037
- }
17893
+ }));
17894
+ }
17895
+ });
17896
+ }
17897
+ });
17898
+ yield Promise.all(promiseList);
18038
17899
  });
18039
- await Promise.all(promiseList);
18040
17900
  }
18041
17901
  function boundStroke(bounds, halfW, miter, pad = 0) {
18042
17902
  bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0)));
@@ -18380,7 +18240,7 @@
18380
18240
  return graphic;
18381
18241
  }
18382
18242
  clone() {
18383
- return new Group({ ...this.attribute });
18243
+ return new Group(Object.assign({}, this.attribute));
18384
18244
  }
18385
18245
  }
18386
18246
 
@@ -18510,17 +18370,7 @@
18510
18370
  combineTo(target, params) {
18511
18371
  var _a;
18512
18372
  if (this.offscreen) {
18513
- this.layerHandler.drawTo(target, [this], {
18514
- background: (_a = params.background) !== null && _a !== void 0 ? _a : this.background,
18515
- renderService: params.renderService,
18516
- x: this.stage.x,
18517
- y: this.stage.y,
18518
- width: this.viewWidth,
18519
- height: this.viewHeight,
18520
- stage: this.stage,
18521
- layer: this,
18522
- ...params
18523
- });
18373
+ this.layerHandler.drawTo(target, [this], Object.assign({ background: (_a = params.background) !== null && _a !== void 0 ? _a : this.background, renderService: params.renderService, x: this.stage.x, y: this.stage.y, width: this.viewWidth, height: this.viewHeight, stage: this.stage, layer: this }, params));
18524
18374
  this.afterDrawCbs.forEach(c => c(this));
18525
18375
  }
18526
18376
  }
@@ -18535,17 +18385,7 @@
18535
18385
  }
18536
18386
  drawTo(target, params) {
18537
18387
  var _a;
18538
- this.layerHandler.drawTo(target, [this], {
18539
- background: (_a = params.background) !== null && _a !== void 0 ? _a : this.background,
18540
- renderService: params.renderService,
18541
- x: this.stage.x,
18542
- y: this.stage.y,
18543
- width: this.viewWidth,
18544
- height: this.viewHeight,
18545
- stage: this.stage,
18546
- layer: this,
18547
- ...params
18548
- });
18388
+ this.layerHandler.drawTo(target, [this], Object.assign({ background: (_a = params.background) !== null && _a !== void 0 ? _a : this.background, renderService: params.renderService, x: this.stage.x, y: this.stage.y, width: this.viewWidth, height: this.viewHeight, stage: this.stage, layer: this }, params));
18549
18389
  this.afterDrawCbs.forEach(c => c(this));
18550
18390
  }
18551
18391
  }
@@ -18567,10 +18407,7 @@
18567
18407
  }
18568
18408
  createLayer(stage, options = { main: false }) {
18569
18409
  this.tryInit();
18570
- const layer = new Layer(stage, this.global, stage.window, {
18571
- ...options,
18572
- virtual: this.staticLayerCountInEnv === 0
18573
- });
18410
+ const layer = new Layer(stage, this.global, stage.window, Object.assign(Object.assign({}, options), { virtual: this.staticLayerCountInEnv === 0 }));
18574
18411
  const stageLayers = this.layerMap.get(stage) || [];
18575
18412
  stageLayers.push(layer);
18576
18413
  this.layerMap.set(stage, stageLayers);
@@ -19659,7 +19496,7 @@
19659
19496
  return path;
19660
19497
  }
19661
19498
  clone() {
19662
- return new Circle({ ...this.attribute });
19499
+ return new Circle(Object.assign({}, this.attribute));
19663
19500
  }
19664
19501
  }
19665
19502
 
@@ -20184,7 +20021,7 @@
20184
20021
  return false;
20185
20022
  }
20186
20023
  clone() {
20187
- return new Text({ ...this.attribute });
20024
+ return new Text(Object.assign({}, this.attribute));
20188
20025
  }
20189
20026
  }
20190
20027
 
@@ -20947,7 +20784,7 @@
20947
20784
  : new CustomPath2D().fromString(symbolInstance.pathStr, x, y, formattedSize[0], formattedSize[1]);
20948
20785
  }
20949
20786
  clone() {
20950
- return new Symbol({ ...this.attribute });
20787
+ return new Symbol(Object.assign({}, this.attribute));
20951
20788
  }
20952
20789
  };
20953
20790
  Symbol$1.userSymbolMap = {};
@@ -21053,7 +20890,7 @@
21053
20890
  return path;
21054
20891
  }
21055
20892
  clone() {
21056
- return new Line({ ...this.attribute });
20893
+ return new Line(Object.assign({}, this.attribute));
21057
20894
  }
21058
20895
  };
21059
20896
 
@@ -21121,7 +20958,7 @@
21121
20958
  return path;
21122
20959
  }
21123
20960
  clone() {
21124
- return new Rect({ ...this.attribute });
20961
+ return new Rect(Object.assign({}, this.attribute));
21125
20962
  }
21126
20963
  }
21127
20964
 
@@ -21333,7 +21170,7 @@
21333
21170
  this.currentStates = [];
21334
21171
  }
21335
21172
  clone() {
21336
- const glyph = new Glyph({ ...this.attribute });
21173
+ const glyph = new Glyph(Object.assign({}, this.attribute));
21337
21174
  glyph.setSubGraphic(this.subGraphic.map(g => g.clone()));
21338
21175
  return glyph;
21339
21176
  }
@@ -21887,7 +21724,7 @@
21887
21724
  return false;
21888
21725
  }
21889
21726
  clone() {
21890
- return new Image({ ...this.attribute });
21727
+ return new Image(Object.assign({}, this.attribute));
21891
21728
  }
21892
21729
  }
21893
21730
 
@@ -22445,7 +22282,7 @@
22445
22282
  this._frameCache = frame;
22446
22283
  }
22447
22284
  clone() {
22448
- return new RichText({ ...this.attribute });
22285
+ return new RichText(Object.assign({}, this.attribute));
22449
22286
  }
22450
22287
  setStage(stage, layer) {
22451
22288
  super.setStage(stage, layer);
@@ -22589,7 +22426,7 @@
22589
22426
  return new CustomPath2D().fromCustomPath2D(this.getParsedPathShape(), x, y);
22590
22427
  }
22591
22428
  clone() {
22592
- return new Path({ ...this.attribute });
22429
+ return new Path(Object.assign({}, this.attribute));
22593
22430
  }
22594
22431
  }
22595
22432
 
@@ -22703,7 +22540,7 @@
22703
22540
  return path;
22704
22541
  }
22705
22542
  clone() {
22706
- return new Area({ ...this.attribute });
22543
+ return new Area(Object.assign({}, this.attribute));
22707
22544
  }
22708
22545
  }
22709
22546
 
@@ -22905,7 +22742,7 @@
22905
22742
  return path;
22906
22743
  }
22907
22744
  clone() {
22908
- return new Arc({ ...this.attribute });
22745
+ return new Arc(Object.assign({}, this.attribute));
22909
22746
  }
22910
22747
  }
22911
22748
 
@@ -23002,7 +22839,7 @@
23002
22839
  return path;
23003
22840
  }
23004
22841
  clone() {
23005
- return new Polygon({ ...this.attribute });
22842
+ return new Polygon(Object.assign({}, this.attribute));
23006
22843
  }
23007
22844
  }
23008
22845
 
@@ -24301,6 +24138,7 @@
24301
24138
  if (maxLineWidth > 0) {
24302
24139
  for (let i = 0; i < lines.length; i++) {
24303
24140
  const str = lines[i];
24141
+ let needCut = true;
24304
24142
  if (i === lineCountLimit - 1) {
24305
24143
  const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);
24306
24144
  linesLayout.push({
@@ -24320,13 +24158,14 @@
24320
24158
  clip.str = '';
24321
24159
  clip.width = 0;
24322
24160
  }
24161
+ needCut = false;
24323
24162
  }
24324
24163
  linesLayout.push({
24325
24164
  str: clip.str,
24326
24165
  width: clip.width
24327
24166
  });
24328
24167
  if (clip.str.length === str.length) ;
24329
- else {
24168
+ else if (needCut) {
24330
24169
  const newStr = str.substring(clip.str.length);
24331
24170
  lines.splice(i + 1, 0, newStr);
24332
24171
  }
@@ -26711,10 +26550,7 @@
26711
26550
  }
26712
26551
  allocate(data) {
26713
26552
  if (!this.pools.length) {
26714
- return wrapCanvas({
26715
- nativeCanvas: application.global.createCanvas(data),
26716
- ...data
26717
- });
26553
+ return wrapCanvas(Object.assign({ nativeCanvas: application.global.createCanvas(data) }, data));
26718
26554
  }
26719
26555
  const m = this.pools.pop();
26720
26556
  m.resize(data.width, data.height);
@@ -26728,10 +26564,7 @@
26728
26564
  height: canvas.height / canvas.dpr,
26729
26565
  dpr: canvas.dpr
26730
26566
  };
26731
- return wrapCanvas({
26732
- nativeCanvas: application.global.createCanvas(data),
26733
- ...data
26734
- });
26567
+ return wrapCanvas(Object.assign({ nativeCanvas: application.global.createCanvas(data) }, data));
26735
26568
  }
26736
26569
  const m = this.pools.pop();
26737
26570
  m.width = canvas.width;
@@ -27437,7 +27270,7 @@
27437
27270
  return;
27438
27271
  }
27439
27272
  draw(params) {
27440
- this.drawContribution.draw(this, { ...this.drawParams });
27273
+ this.drawContribution.draw(this, Object.assign({}, this.drawParams));
27441
27274
  }
27442
27275
  afterDraw(params) {
27443
27276
  return;
@@ -27522,8 +27355,10 @@
27522
27355
  graphic.forEachChildren(cb, reverse);
27523
27356
  }
27524
27357
  }
27525
- async function foreachAsync(graphic, defaultZIndex, cb, reverse = false) {
27526
- await graphic.forEachChildrenAsync(cb, reverse);
27358
+ function foreachAsync(graphic, defaultZIndex, cb, reverse = false) {
27359
+ return __awaiter(this, void 0, void 0, function* () {
27360
+ yield graphic.forEachChildrenAsync(cb, reverse);
27361
+ });
27527
27362
  }
27528
27363
  function findNextGraphic(graphic, id, defaultZIndex, reverse = false) {
27529
27364
  const childMap = {};
@@ -28131,12 +27966,12 @@
28131
27966
  }
28132
27967
  class OrthoCamera {
28133
27968
  set params(params) {
28134
- this._params = { ...params };
27969
+ this._params = Object.assign({}, params);
28135
27970
  this._projectionMatrixCached = this.forceGetProjectionMatrix();
28136
27971
  this._viewMatrixCached = this.forceGetViewMatrix();
28137
27972
  }
28138
27973
  get params() {
28139
- return { ...this._params };
27974
+ return Object.assign({}, this._params);
28140
27975
  }
28141
27976
  constructor(params) {
28142
27977
  this.params = params;
@@ -28350,9 +28185,9 @@
28350
28185
  }
28351
28186
  }
28352
28187
  constructor(canvas, dpr) {
28353
- this.fillAttributes = { ...DefaultFillStyle, opacity: 1 };
28354
- this.strokeAttributes = { ...DefaultStrokeStyle, opacity: 1 };
28355
- this.textAttributes = { ...DefaultTextStyle, opacity: 1 };
28188
+ this.fillAttributes = Object.assign(Object.assign({}, DefaultFillStyle), { opacity: 1 });
28189
+ this.strokeAttributes = Object.assign(Object.assign({}, DefaultStrokeStyle), { opacity: 1 });
28190
+ this.textAttributes = Object.assign(Object.assign({}, DefaultTextStyle), { opacity: 1 });
28356
28191
  this._clearShadowStyle = false;
28357
28192
  this._clearFilterStyle = false;
28358
28193
  const context = canvas.nativeCanvas.getContext('2d');
@@ -30483,28 +30318,30 @@
30483
30318
  injectable()
30484
30319
  ], NodeEnvContribution);
30485
30320
 
30486
- async function makeUpCanvas(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
30487
- const dpr = wx.getSystemInfoSync().pixelRatio;
30488
- for (let i = 0; i < canvasIdLists.length; i++) {
30489
- const id = canvasIdLists[i];
30490
- await new Promise(resolve => {
30491
- wx.createSelectorQuery()
30492
- .select(`#${id}`)
30493
- .fields({ node: true, size: true })
30494
- .exec((res) => {
30495
- const canvas = res[0].node;
30496
- const width = res[0].width;
30497
- const height = res[0].height;
30498
- canvas.width = width * dpr;
30499
- canvas.height = height * dpr;
30500
- canvasMap.set(id, canvas);
30501
- if (i >= freeCanvasIdx) {
30502
- freeCanvasList.push(canvas);
30503
- }
30504
- resolve(null);
30321
+ function makeUpCanvas(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
30322
+ return __awaiter(this, void 0, void 0, function* () {
30323
+ const dpr = wx.getSystemInfoSync().pixelRatio;
30324
+ for (let i = 0; i < canvasIdLists.length; i++) {
30325
+ const id = canvasIdLists[i];
30326
+ yield new Promise(resolve => {
30327
+ wx.createSelectorQuery()
30328
+ .select(`#${id}`)
30329
+ .fields({ node: true, size: true })
30330
+ .exec((res) => {
30331
+ const canvas = res[0].node;
30332
+ const width = res[0].width;
30333
+ const height = res[0].height;
30334
+ canvas.width = width * dpr;
30335
+ canvas.height = height * dpr;
30336
+ canvasMap.set(id, canvas);
30337
+ if (i >= freeCanvasIdx) {
30338
+ freeCanvasList.push(canvas);
30339
+ }
30340
+ resolve(null);
30341
+ });
30505
30342
  });
30506
- });
30507
- }
30343
+ }
30344
+ });
30508
30345
  }
30509
30346
  let WxEnvContribution = class WxEnvContribution extends exports.BaseEnvContribution {
30510
30347
  constructor() {
@@ -31500,22 +31337,14 @@
31500
31337
  }
31501
31338
  if (event.changedTouches.length > 0) {
31502
31339
  event.changedTouches.forEach((d, i) => {
31503
- event.changedTouches[i] = {
31504
- ...event.changedTouches[i],
31505
- offsetX: d.x,
31506
- offsetY: d.y
31507
- };
31340
+ event.changedTouches[i] = Object.assign(Object.assign({}, event.changedTouches[i]), { offsetX: d.x, offsetY: d.y });
31508
31341
  });
31509
31342
  event.offsetX = event.changedTouches[0].offsetX;
31510
31343
  event.offsetY = event.changedTouches[0].offsetY;
31511
31344
  }
31512
31345
  if (event.touches.length > 0) {
31513
31346
  event.touches.forEach((d, i) => {
31514
- event.touches[i] = {
31515
- ...event.touches[i],
31516
- offsetX: d.x,
31517
- offsetY: d.y
31518
- };
31347
+ event.touches[i] = Object.assign(Object.assign({}, event.touches[i]), { offsetX: d.x, offsetY: d.y });
31519
31348
  });
31520
31349
  }
31521
31350
  event.preventDefault = () => {
@@ -32609,12 +32438,7 @@
32609
32438
  this.canvas.applyPosition();
32610
32439
  }
32611
32440
  }
32612
- params.renderService.render(group, {
32613
- context: this.context,
32614
- clear: (_a = params.background) !== null && _a !== void 0 ? _a : '#ffffff',
32615
- ...params,
32616
- ...userParams
32617
- });
32441
+ params.renderService.render(group, Object.assign(Object.assign({ context: this.context, clear: (_a = params.background) !== null && _a !== void 0 ? _a : '#ffffff' }, params), userParams));
32618
32442
  }
32619
32443
  merge(layerHandlers) {
32620
32444
  layerHandlers.forEach(l => {
@@ -32629,11 +32453,7 @@
32629
32453
  drawTo(target, group, params) {
32630
32454
  var _a;
32631
32455
  const context = target.getContext();
32632
- params.renderService.render(group, {
32633
- context,
32634
- ...params,
32635
- clear: params.clear ? (_a = params.background) !== null && _a !== void 0 ? _a : '#fff' : undefined
32636
- });
32456
+ params.renderService.render(group, Object.assign(Object.assign({ context }, params), { clear: params.clear ? (_a = params.background) !== null && _a !== void 0 ? _a : '#fff' : undefined }));
32637
32457
  return;
32638
32458
  }
32639
32459
  getContext() {
@@ -32681,13 +32501,7 @@
32681
32501
  }
32682
32502
  render(group, params) {
32683
32503
  var _a;
32684
- params.renderService.render(group, {
32685
- context: this.context,
32686
- ...params,
32687
- x: 0,
32688
- y: 0,
32689
- clear: (_a = params.background) !== null && _a !== void 0 ? _a : '#ffffff'
32690
- });
32504
+ params.renderService.render(group, Object.assign(Object.assign({ context: this.context }, params), { x: 0, y: 0, clear: (_a = params.background) !== null && _a !== void 0 ? _a : '#ffffff' }));
32691
32505
  }
32692
32506
  prepare(dirtyBounds, params) {
32693
32507
  return;
@@ -33058,15 +32872,7 @@
33058
32872
  const idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
33059
32873
  idc.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);
33060
32874
  idc.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);
33061
- idc.draw(this.currentRenderService, {
33062
- ...drawContext,
33063
- drawContribution: idc,
33064
- clear: 'transparent',
33065
- layer: incrementalLayer.layer,
33066
- context: incrementalContext,
33067
- startAtId: group._uid,
33068
- break: false
33069
- });
32875
+ idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), { drawContribution: idc, clear: 'transparent', layer: incrementalLayer.layer, context: incrementalContext, startAtId: group._uid, break: false }));
33070
32876
  incrementalLayer.drawContribution = idc;
33071
32877
  const nextGraphic = this._findNextGraphic(group);
33072
32878
  if (nextGraphic) {
@@ -33083,15 +32889,7 @@
33083
32889
  subLayers.set(nextGraphic._uid, afterLayer);
33084
32890
  }
33085
32891
  const afterContext = afterLayer.layer.getNativeHandler().getContext();
33086
- this.draw(this.currentRenderService, {
33087
- ...drawContext,
33088
- drawContribution: idc,
33089
- clear: 'transparent',
33090
- layer: afterLayer.layer,
33091
- context: afterContext,
33092
- startAtId: nextGraphic._uid,
33093
- break: false
33094
- });
32892
+ this.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), { drawContribution: idc, clear: 'transparent', layer: afterLayer.layer, context: afterContext, startAtId: nextGraphic._uid, break: false }));
33095
32893
  }
33096
32894
  }
33097
32895
  }
@@ -33486,164 +33284,178 @@
33486
33284
  this.defaultRenderMap.set(this.lineRender.numberType, this.lineRender);
33487
33285
  this.defaultRenderMap.set(this.areaRender.numberType, this.areaRender);
33488
33286
  }
33489
- async draw(renderService, drawContext) {
33490
- if (this.checkingForDrawPromise) {
33491
- return;
33492
- }
33493
- this.lastRenderService = renderService;
33494
- this.lastDrawContext = drawContext;
33495
- this.checkingForDrawPromise = this.checkForDraw(drawContext);
33496
- const skipDraw = await this.checkingForDrawPromise;
33497
- this.checkingForDrawPromise = null;
33498
- if (skipDraw) {
33499
- return;
33500
- }
33501
- this.currentRenderService = renderService;
33502
- const { context, x = 0, y = 0 } = drawContext;
33503
- if (!context) {
33504
- return;
33505
- }
33506
- context.inuse = true;
33507
- context.clearMatrix();
33508
- context.setTransformForCurrent(true);
33509
- context.save();
33510
- drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext);
33511
- context.translate(x, y, true);
33512
- context.save();
33513
- renderService.renderTreeRoots
33514
- .sort((a, b) => {
33515
- var _a, _b;
33516
- return ((_a = a.attribute.zIndex) !== null && _a !== void 0 ? _a : DefaultAttribute.zIndex) - ((_b = b.attribute.zIndex) !== null && _b !== void 0 ? _b : DefaultAttribute.zIndex);
33517
- })
33518
- .forEach(group => {
33519
- this.renderGroup(group, drawContext);
33520
- });
33521
- this.hooks.completeDraw.tap('top-draw', () => {
33522
- context.restore();
33523
- context.restore();
33524
- context.draw();
33525
- context.inuse = false;
33526
- this.rendering = false;
33287
+ draw(renderService, drawContext) {
33288
+ return __awaiter(this, void 0, void 0, function* () {
33289
+ if (this.checkingForDrawPromise) {
33290
+ return;
33291
+ }
33292
+ this.lastRenderService = renderService;
33293
+ this.lastDrawContext = drawContext;
33294
+ this.checkingForDrawPromise = this.checkForDraw(drawContext);
33295
+ const skipDraw = yield this.checkingForDrawPromise;
33296
+ this.checkingForDrawPromise = null;
33297
+ if (skipDraw) {
33298
+ return;
33299
+ }
33300
+ this.currentRenderService = renderService;
33301
+ const { context, x = 0, y = 0 } = drawContext;
33302
+ if (!context) {
33303
+ return;
33304
+ }
33305
+ context.inuse = true;
33306
+ context.clearMatrix();
33307
+ context.setTransformForCurrent(true);
33308
+ context.save();
33309
+ drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext);
33310
+ context.translate(x, y, true);
33311
+ context.save();
33312
+ renderService.renderTreeRoots
33313
+ .sort((a, b) => {
33314
+ var _a, _b;
33315
+ return ((_a = a.attribute.zIndex) !== null && _a !== void 0 ? _a : DefaultAttribute.zIndex) - ((_b = b.attribute.zIndex) !== null && _b !== void 0 ? _b : DefaultAttribute.zIndex);
33316
+ })
33317
+ .forEach(group => {
33318
+ this.renderGroup(group, drawContext);
33319
+ });
33320
+ this.hooks.completeDraw.tap('top-draw', () => {
33321
+ context.restore();
33322
+ context.restore();
33323
+ context.draw();
33324
+ context.inuse = false;
33325
+ this.rendering = false;
33326
+ });
33527
33327
  });
33528
33328
  }
33529
- async _increaseRender(group, drawContext) {
33530
- this.rendering = true;
33531
- await this._renderIncrementalGroup(group, drawContext);
33532
- return;
33329
+ _increaseRender(group, drawContext) {
33330
+ return __awaiter(this, void 0, void 0, function* () {
33331
+ this.rendering = true;
33332
+ yield this._renderIncrementalGroup(group, drawContext);
33333
+ return;
33334
+ });
33533
33335
  }
33534
- async _renderIncrementalGroup(group, drawContext) {
33535
- this.count = group.count;
33536
- await new Promise(resolve => {
33537
- this.renderItem(group, drawContext, {
33538
- drawingCb: async () => {
33539
- if (group.count === 2) {
33540
- const graphic = group.getChildAt(0);
33541
- if (graphic.incremental && graphic.attribute.segments) {
33542
- if (!graphic.incrementalAt) {
33543
- graphic.incrementalAt = 0;
33336
+ _renderIncrementalGroup(group, drawContext) {
33337
+ return __awaiter(this, void 0, void 0, function* () {
33338
+ this.count = group.count;
33339
+ yield new Promise(resolve => {
33340
+ this.renderItem(group, drawContext, {
33341
+ drawingCb: () => __awaiter(this, void 0, void 0, function* () {
33342
+ if (group.count === 2) {
33343
+ const graphic = group.getChildAt(0);
33344
+ if (graphic.incremental && graphic.attribute.segments) {
33345
+ if (!graphic.incrementalAt) {
33346
+ graphic.incrementalAt = 0;
33347
+ }
33348
+ while (graphic.incrementalAt < graphic.attribute.segments.length) {
33349
+ drawContext.multiGraphicOptions = {
33350
+ startAtIdx: graphic.incrementalAt,
33351
+ length: graphic.incremental
33352
+ };
33353
+ this.renderItem(graphic, drawContext);
33354
+ graphic.incrementalAt += graphic.incremental;
33355
+ yield this.waitToNextFrame();
33356
+ }
33544
33357
  }
33545
- while (graphic.incrementalAt < graphic.attribute.segments.length) {
33546
- drawContext.multiGraphicOptions = {
33547
- startAtIdx: graphic.incrementalAt,
33548
- length: graphic.incremental
33549
- };
33358
+ else {
33550
33359
  this.renderItem(graphic, drawContext);
33551
- graphic.incrementalAt += graphic.incremental;
33552
- await this.waitToNextFrame();
33553
33360
  }
33361
+ resolve(false);
33362
+ return;
33554
33363
  }
33555
- else {
33556
- this.renderItem(graphic, drawContext);
33557
- }
33558
- resolve(false);
33559
- return;
33560
- }
33561
- await foreachAsync(group, DefaultAttribute.zIndex, (item, i) => {
33562
- if (this.status === STATUS.STOP) {
33563
- return true;
33564
- }
33565
- if (item.isContainer) {
33566
- return false;
33567
- }
33568
- if (i < this.currentIdx) {
33364
+ yield foreachAsync(group, DefaultAttribute.zIndex, (item, i) => {
33365
+ if (this.status === STATUS.STOP) {
33366
+ return true;
33367
+ }
33368
+ if (item.isContainer) {
33369
+ return false;
33370
+ }
33371
+ if (i < this.currentIdx) {
33372
+ return false;
33373
+ }
33374
+ const frameTail = this.currFrameStartAt + group.incremental;
33375
+ if (i < frameTail) {
33376
+ this.currentIdx = i + 1;
33377
+ this.renderItem(item, drawContext);
33378
+ }
33379
+ if (i === frameTail - 1) {
33380
+ this.currFrameStartAt = this.currentIdx;
33381
+ return this.waitToNextFrame();
33382
+ }
33569
33383
  return false;
33570
- }
33571
- const frameTail = this.currFrameStartAt + group.incremental;
33572
- if (i < frameTail) {
33573
- this.currentIdx = i + 1;
33574
- this.renderItem(item, drawContext);
33575
- }
33576
- if (i === frameTail - 1) {
33577
- this.currFrameStartAt = this.currentIdx;
33578
- return this.waitToNextFrame();
33579
- }
33580
- return false;
33581
- });
33582
- resolve(false);
33583
- }
33384
+ });
33385
+ resolve(false);
33386
+ })
33387
+ });
33584
33388
  });
33389
+ this.hooks.completeDraw.call();
33585
33390
  });
33586
- this.hooks.completeDraw.call();
33587
33391
  }
33588
- async waitToNextFrame() {
33589
- return new Promise(resolve => {
33590
- this.global.getRequestAnimationFrame()(() => {
33591
- resolve(false);
33392
+ waitToNextFrame() {
33393
+ return __awaiter(this, void 0, void 0, function* () {
33394
+ return new Promise(resolve => {
33395
+ this.global.getRequestAnimationFrame()(() => {
33396
+ resolve(false);
33397
+ });
33592
33398
  });
33593
33399
  });
33594
33400
  }
33595
- async checkForDraw(drawContext) {
33596
- let skip = this.rendering;
33597
- if (drawContext.restartIncremental) {
33598
- skip = false;
33599
- await this.forceStop();
33600
- this.resetToInit();
33601
- }
33602
- return skip;
33401
+ checkForDraw(drawContext) {
33402
+ return __awaiter(this, void 0, void 0, function* () {
33403
+ let skip = this.rendering;
33404
+ if (drawContext.restartIncremental) {
33405
+ skip = false;
33406
+ yield this.forceStop();
33407
+ this.resetToInit();
33408
+ }
33409
+ return skip;
33410
+ });
33603
33411
  }
33604
- async forceStop() {
33605
- if (this.rendering) {
33606
- this.status = STATUS.STOP;
33607
- await new Promise(resolve => {
33608
- this.hooks.completeDraw.tap('stopCb', () => {
33609
- this.status = STATUS.NORMAL;
33610
- this.hooks.completeDraw.taps = this.hooks.completeDraw.taps.filter(item => {
33611
- return item.name !== 'stopCb';
33412
+ forceStop() {
33413
+ return __awaiter(this, void 0, void 0, function* () {
33414
+ if (this.rendering) {
33415
+ this.status = STATUS.STOP;
33416
+ yield new Promise(resolve => {
33417
+ this.hooks.completeDraw.tap('stopCb', () => {
33418
+ this.status = STATUS.NORMAL;
33419
+ this.hooks.completeDraw.taps = this.hooks.completeDraw.taps.filter(item => {
33420
+ return item.name !== 'stopCb';
33421
+ });
33422
+ resolve(false);
33612
33423
  });
33613
- resolve(false);
33614
33424
  });
33615
- });
33616
- }
33425
+ }
33426
+ });
33617
33427
  }
33618
33428
  resetToInit() {
33619
33429
  this.currFrameStartAt = 0;
33620
33430
  this.currentIdx = 0;
33621
33431
  }
33622
- async renderGroup(group, drawContext) {
33623
- if (drawContext.break || group.attribute.visibleAll === false) {
33624
- return;
33625
- }
33626
- if (group.incremental && drawContext.startAtId === group._uid) {
33627
- await this._increaseRender(group, drawContext);
33628
- drawContext.break = true;
33629
- return;
33630
- }
33631
- await new Promise(resolve => {
33632
- this.renderItem(group, drawContext, {
33633
- drawingCb: async () => {
33634
- await foreachAsync(group, DefaultAttribute.zIndex, async (item) => {
33635
- if (drawContext.break) {
33636
- return;
33637
- }
33638
- if (item.isContainer) {
33639
- await this.renderGroup(item, drawContext);
33640
- }
33641
- else {
33642
- return;
33643
- }
33644
- });
33645
- resolve(false);
33646
- }
33432
+ renderGroup(group, drawContext) {
33433
+ return __awaiter(this, void 0, void 0, function* () {
33434
+ if (drawContext.break || group.attribute.visibleAll === false) {
33435
+ return;
33436
+ }
33437
+ if (group.incremental && drawContext.startAtId === group._uid) {
33438
+ yield this._increaseRender(group, drawContext);
33439
+ drawContext.break = true;
33440
+ return;
33441
+ }
33442
+ yield new Promise(resolve => {
33443
+ this.renderItem(group, drawContext, {
33444
+ drawingCb: () => __awaiter(this, void 0, void 0, function* () {
33445
+ yield foreachAsync(group, DefaultAttribute.zIndex, (item) => __awaiter(this, void 0, void 0, function* () {
33446
+ if (drawContext.break) {
33447
+ return;
33448
+ }
33449
+ if (item.isContainer) {
33450
+ yield this.renderGroup(item, drawContext);
33451
+ }
33452
+ else {
33453
+ return;
33454
+ }
33455
+ }));
33456
+ resolve(false);
33457
+ })
33458
+ });
33647
33459
  });
33648
33460
  });
33649
33461
  }
@@ -36186,20 +35998,8 @@
36186
35998
  if (!subLayer || !subLayer.drawContribution) {
36187
35999
  return;
36188
36000
  }
36189
- subLayer.drawContribution.draw(stage.renderService, {
36190
- x: stage.x,
36191
- y: stage.y,
36192
- width: layer.viewWidth,
36193
- height: layer.viewHeight,
36194
- stage,
36195
- layer,
36196
- clear: 'transparent',
36197
- renderService: stage.renderService,
36198
- updateBounds: false,
36199
- startAtId: group._uid,
36200
- context: subLayer.layer.getNativeHandler().getContext(),
36201
- ...this.nextUserParams
36202
- });
36001
+ subLayer.drawContribution.draw(stage.renderService, Object.assign({ x: stage.x, y: stage.y, width: layer.viewWidth, height: layer.viewHeight, stage,
36002
+ layer, clear: 'transparent', renderService: stage.renderService, updateBounds: false, startAtId: group._uid, context: subLayer.layer.getNativeHandler().getContext() }, this.nextUserParams));
36203
36003
  });
36204
36004
  this.nextUserParams = {};
36205
36005
  this.nextFrameRenderGroupSet.clear();
@@ -36512,8 +36312,8 @@
36512
36312
 
36513
36313
  const defaultTicker = new DefaultTicker();
36514
36314
  defaultTicker.addTimeline(defaultTimeline);
36515
- const DEFAULT_TICKER_FPS = 60;
36516
- defaultTicker.setFPS(DEFAULT_TICKER_FPS);
36315
+ const TICKER_FPS = 60;
36316
+ defaultTicker.setFPS(TICKER_FPS);
36517
36317
 
36518
36318
  class DirectionalLight {
36519
36319
  constructor(dir, color, ambient = 0.8) {
@@ -36697,16 +36497,13 @@
36697
36497
  }
36698
36498
  get3dOptions(options) {
36699
36499
  const { center = { x: this.width / 2, y: this.height / 2, z: 0, dx: 0, dy: 0, dz: 0 }, light = {}, alpha = 0, beta = 0, camera, fieldRatio = 1, fieldDepth } = options;
36700
- return {
36701
- ...options,
36702
- center,
36500
+ return Object.assign(Object.assign({}, options), { center,
36703
36501
  light,
36704
36502
  alpha,
36705
36503
  beta,
36706
36504
  camera,
36707
36505
  fieldRatio,
36708
- fieldDepth
36709
- };
36506
+ fieldDepth });
36710
36507
  }
36711
36508
  set3dOptions(options) {
36712
36509
  var _a, _b, _c, _d, _e, _f;
@@ -36893,7 +36690,7 @@
36893
36690
  renderService: this.renderService,
36894
36691
  background: layer === this.defaultLayer ? this.background : undefined,
36895
36692
  updateBounds: !!this.dirtyBounds
36896
- }, { renderStyle: this.renderStyle, ...params });
36693
+ }, Object.assign({ renderStyle: this.renderStyle }, params));
36897
36694
  });
36898
36695
  this.combineLayersToWindow();
36899
36696
  this.nextFrameRenderLayerSet.clear();
@@ -36936,7 +36733,7 @@
36936
36733
  renderService: this.renderService,
36937
36734
  background: layer === this.defaultLayer ? this.background : undefined,
36938
36735
  updateBounds: !!this.dirtyBounds
36939
- }, { renderStyle: this.renderStyle, ...(this.lastRenderparams || {}) });
36736
+ }, Object.assign({ renderStyle: this.renderStyle }, (this.lastRenderparams || {})));
36940
36737
  }
36941
36738
  });
36942
36739
  this.combineLayersToWindow();
@@ -36964,7 +36761,7 @@
36964
36761
  this.forEachChildren(c => {
36965
36762
  c.resizeView(w, h);
36966
36763
  });
36967
- this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });
36764
+ this.camera && (this.camera.params = Object.assign(Object.assign({}, this.camera.params), { right: this.width, bottom: this.height }));
36968
36765
  rerender && this.render();
36969
36766
  }
36970
36767
  setViewBox(x, y, w, h, rerender) {
@@ -37040,13 +36837,7 @@
37040
36837
  }
37041
36838
  renderTo(window, params) {
37042
36839
  this.forEachChildren((layer, i) => {
37043
- layer.drawTo(window, {
37044
- ...params,
37045
- renderService: this.renderService,
37046
- background: layer === this.defaultLayer ? this.background : undefined,
37047
- clear: i === 0,
37048
- updateBounds: !!this.dirtyBounds
37049
- });
36840
+ layer.drawTo(window, Object.assign(Object.assign({}, params), { renderService: this.renderService, background: layer === this.defaultLayer ? this.background : undefined, clear: i === 0, updateBounds: !!this.dirtyBounds }));
37050
36841
  });
37051
36842
  }
37052
36843
  renderToNewWindow(fullImage = true) {
@@ -37119,7 +36910,7 @@
37119
36910
  'rect'
37120
36911
  ];
37121
36912
 
37122
- const version = "0.14.1";
36913
+ const version = "0.14.3";
37123
36914
 
37124
36915
  exports.ACustomAnimate = ACustomAnimate;
37125
36916
  exports.ARC3D_NUMBER_TYPE = ARC3D_NUMBER_TYPE;