@visactor/vrender 0.14.1 → 0.14.2

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
 
@@ -26711,10 +26548,7 @@
26711
26548
  }
26712
26549
  allocate(data) {
26713
26550
  if (!this.pools.length) {
26714
- return wrapCanvas({
26715
- nativeCanvas: application.global.createCanvas(data),
26716
- ...data
26717
- });
26551
+ return wrapCanvas(Object.assign({ nativeCanvas: application.global.createCanvas(data) }, data));
26718
26552
  }
26719
26553
  const m = this.pools.pop();
26720
26554
  m.resize(data.width, data.height);
@@ -26728,10 +26562,7 @@
26728
26562
  height: canvas.height / canvas.dpr,
26729
26563
  dpr: canvas.dpr
26730
26564
  };
26731
- return wrapCanvas({
26732
- nativeCanvas: application.global.createCanvas(data),
26733
- ...data
26734
- });
26565
+ return wrapCanvas(Object.assign({ nativeCanvas: application.global.createCanvas(data) }, data));
26735
26566
  }
26736
26567
  const m = this.pools.pop();
26737
26568
  m.width = canvas.width;
@@ -27437,7 +27268,7 @@
27437
27268
  return;
27438
27269
  }
27439
27270
  draw(params) {
27440
- this.drawContribution.draw(this, { ...this.drawParams });
27271
+ this.drawContribution.draw(this, Object.assign({}, this.drawParams));
27441
27272
  }
27442
27273
  afterDraw(params) {
27443
27274
  return;
@@ -27522,8 +27353,10 @@
27522
27353
  graphic.forEachChildren(cb, reverse);
27523
27354
  }
27524
27355
  }
27525
- async function foreachAsync(graphic, defaultZIndex, cb, reverse = false) {
27526
- await graphic.forEachChildrenAsync(cb, reverse);
27356
+ function foreachAsync(graphic, defaultZIndex, cb, reverse = false) {
27357
+ return __awaiter(this, void 0, void 0, function* () {
27358
+ yield graphic.forEachChildrenAsync(cb, reverse);
27359
+ });
27527
27360
  }
27528
27361
  function findNextGraphic(graphic, id, defaultZIndex, reverse = false) {
27529
27362
  const childMap = {};
@@ -28131,12 +27964,12 @@
28131
27964
  }
28132
27965
  class OrthoCamera {
28133
27966
  set params(params) {
28134
- this._params = { ...params };
27967
+ this._params = Object.assign({}, params);
28135
27968
  this._projectionMatrixCached = this.forceGetProjectionMatrix();
28136
27969
  this._viewMatrixCached = this.forceGetViewMatrix();
28137
27970
  }
28138
27971
  get params() {
28139
- return { ...this._params };
27972
+ return Object.assign({}, this._params);
28140
27973
  }
28141
27974
  constructor(params) {
28142
27975
  this.params = params;
@@ -28350,9 +28183,9 @@
28350
28183
  }
28351
28184
  }
28352
28185
  constructor(canvas, dpr) {
28353
- this.fillAttributes = { ...DefaultFillStyle, opacity: 1 };
28354
- this.strokeAttributes = { ...DefaultStrokeStyle, opacity: 1 };
28355
- this.textAttributes = { ...DefaultTextStyle, opacity: 1 };
28186
+ this.fillAttributes = Object.assign(Object.assign({}, DefaultFillStyle), { opacity: 1 });
28187
+ this.strokeAttributes = Object.assign(Object.assign({}, DefaultStrokeStyle), { opacity: 1 });
28188
+ this.textAttributes = Object.assign(Object.assign({}, DefaultTextStyle), { opacity: 1 });
28356
28189
  this._clearShadowStyle = false;
28357
28190
  this._clearFilterStyle = false;
28358
28191
  const context = canvas.nativeCanvas.getContext('2d');
@@ -30483,28 +30316,30 @@
30483
30316
  injectable()
30484
30317
  ], NodeEnvContribution);
30485
30318
 
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);
30319
+ function makeUpCanvas(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
30320
+ return __awaiter(this, void 0, void 0, function* () {
30321
+ const dpr = wx.getSystemInfoSync().pixelRatio;
30322
+ for (let i = 0; i < canvasIdLists.length; i++) {
30323
+ const id = canvasIdLists[i];
30324
+ yield new Promise(resolve => {
30325
+ wx.createSelectorQuery()
30326
+ .select(`#${id}`)
30327
+ .fields({ node: true, size: true })
30328
+ .exec((res) => {
30329
+ const canvas = res[0].node;
30330
+ const width = res[0].width;
30331
+ const height = res[0].height;
30332
+ canvas.width = width * dpr;
30333
+ canvas.height = height * dpr;
30334
+ canvasMap.set(id, canvas);
30335
+ if (i >= freeCanvasIdx) {
30336
+ freeCanvasList.push(canvas);
30337
+ }
30338
+ resolve(null);
30339
+ });
30505
30340
  });
30506
- });
30507
- }
30341
+ }
30342
+ });
30508
30343
  }
30509
30344
  let WxEnvContribution = class WxEnvContribution extends exports.BaseEnvContribution {
30510
30345
  constructor() {
@@ -31500,22 +31335,14 @@
31500
31335
  }
31501
31336
  if (event.changedTouches.length > 0) {
31502
31337
  event.changedTouches.forEach((d, i) => {
31503
- event.changedTouches[i] = {
31504
- ...event.changedTouches[i],
31505
- offsetX: d.x,
31506
- offsetY: d.y
31507
- };
31338
+ event.changedTouches[i] = Object.assign(Object.assign({}, event.changedTouches[i]), { offsetX: d.x, offsetY: d.y });
31508
31339
  });
31509
31340
  event.offsetX = event.changedTouches[0].offsetX;
31510
31341
  event.offsetY = event.changedTouches[0].offsetY;
31511
31342
  }
31512
31343
  if (event.touches.length > 0) {
31513
31344
  event.touches.forEach((d, i) => {
31514
- event.touches[i] = {
31515
- ...event.touches[i],
31516
- offsetX: d.x,
31517
- offsetY: d.y
31518
- };
31345
+ event.touches[i] = Object.assign(Object.assign({}, event.touches[i]), { offsetX: d.x, offsetY: d.y });
31519
31346
  });
31520
31347
  }
31521
31348
  event.preventDefault = () => {
@@ -32609,12 +32436,7 @@
32609
32436
  this.canvas.applyPosition();
32610
32437
  }
32611
32438
  }
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
- });
32439
+ params.renderService.render(group, Object.assign(Object.assign({ context: this.context, clear: (_a = params.background) !== null && _a !== void 0 ? _a : '#ffffff' }, params), userParams));
32618
32440
  }
32619
32441
  merge(layerHandlers) {
32620
32442
  layerHandlers.forEach(l => {
@@ -32629,11 +32451,7 @@
32629
32451
  drawTo(target, group, params) {
32630
32452
  var _a;
32631
32453
  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
- });
32454
+ params.renderService.render(group, Object.assign(Object.assign({ context }, params), { clear: params.clear ? (_a = params.background) !== null && _a !== void 0 ? _a : '#fff' : undefined }));
32637
32455
  return;
32638
32456
  }
32639
32457
  getContext() {
@@ -32681,13 +32499,7 @@
32681
32499
  }
32682
32500
  render(group, params) {
32683
32501
  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
- });
32502
+ 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
32503
  }
32692
32504
  prepare(dirtyBounds, params) {
32693
32505
  return;
@@ -33058,15 +32870,7 @@
33058
32870
  const idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
33059
32871
  idc.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);
33060
32872
  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
- });
32873
+ idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), { drawContribution: idc, clear: 'transparent', layer: incrementalLayer.layer, context: incrementalContext, startAtId: group._uid, break: false }));
33070
32874
  incrementalLayer.drawContribution = idc;
33071
32875
  const nextGraphic = this._findNextGraphic(group);
33072
32876
  if (nextGraphic) {
@@ -33083,15 +32887,7 @@
33083
32887
  subLayers.set(nextGraphic._uid, afterLayer);
33084
32888
  }
33085
32889
  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
- });
32890
+ this.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), { drawContribution: idc, clear: 'transparent', layer: afterLayer.layer, context: afterContext, startAtId: nextGraphic._uid, break: false }));
33095
32891
  }
33096
32892
  }
33097
32893
  }
@@ -33486,164 +33282,178 @@
33486
33282
  this.defaultRenderMap.set(this.lineRender.numberType, this.lineRender);
33487
33283
  this.defaultRenderMap.set(this.areaRender.numberType, this.areaRender);
33488
33284
  }
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;
33285
+ draw(renderService, drawContext) {
33286
+ return __awaiter(this, void 0, void 0, function* () {
33287
+ if (this.checkingForDrawPromise) {
33288
+ return;
33289
+ }
33290
+ this.lastRenderService = renderService;
33291
+ this.lastDrawContext = drawContext;
33292
+ this.checkingForDrawPromise = this.checkForDraw(drawContext);
33293
+ const skipDraw = yield this.checkingForDrawPromise;
33294
+ this.checkingForDrawPromise = null;
33295
+ if (skipDraw) {
33296
+ return;
33297
+ }
33298
+ this.currentRenderService = renderService;
33299
+ const { context, x = 0, y = 0 } = drawContext;
33300
+ if (!context) {
33301
+ return;
33302
+ }
33303
+ context.inuse = true;
33304
+ context.clearMatrix();
33305
+ context.setTransformForCurrent(true);
33306
+ context.save();
33307
+ drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext);
33308
+ context.translate(x, y, true);
33309
+ context.save();
33310
+ renderService.renderTreeRoots
33311
+ .sort((a, b) => {
33312
+ var _a, _b;
33313
+ return ((_a = a.attribute.zIndex) !== null && _a !== void 0 ? _a : DefaultAttribute.zIndex) - ((_b = b.attribute.zIndex) !== null && _b !== void 0 ? _b : DefaultAttribute.zIndex);
33314
+ })
33315
+ .forEach(group => {
33316
+ this.renderGroup(group, drawContext);
33317
+ });
33318
+ this.hooks.completeDraw.tap('top-draw', () => {
33319
+ context.restore();
33320
+ context.restore();
33321
+ context.draw();
33322
+ context.inuse = false;
33323
+ this.rendering = false;
33324
+ });
33527
33325
  });
33528
33326
  }
33529
- async _increaseRender(group, drawContext) {
33530
- this.rendering = true;
33531
- await this._renderIncrementalGroup(group, drawContext);
33532
- return;
33327
+ _increaseRender(group, drawContext) {
33328
+ return __awaiter(this, void 0, void 0, function* () {
33329
+ this.rendering = true;
33330
+ yield this._renderIncrementalGroup(group, drawContext);
33331
+ return;
33332
+ });
33533
33333
  }
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;
33334
+ _renderIncrementalGroup(group, drawContext) {
33335
+ return __awaiter(this, void 0, void 0, function* () {
33336
+ this.count = group.count;
33337
+ yield new Promise(resolve => {
33338
+ this.renderItem(group, drawContext, {
33339
+ drawingCb: () => __awaiter(this, void 0, void 0, function* () {
33340
+ if (group.count === 2) {
33341
+ const graphic = group.getChildAt(0);
33342
+ if (graphic.incremental && graphic.attribute.segments) {
33343
+ if (!graphic.incrementalAt) {
33344
+ graphic.incrementalAt = 0;
33345
+ }
33346
+ while (graphic.incrementalAt < graphic.attribute.segments.length) {
33347
+ drawContext.multiGraphicOptions = {
33348
+ startAtIdx: graphic.incrementalAt,
33349
+ length: graphic.incremental
33350
+ };
33351
+ this.renderItem(graphic, drawContext);
33352
+ graphic.incrementalAt += graphic.incremental;
33353
+ yield this.waitToNextFrame();
33354
+ }
33544
33355
  }
33545
- while (graphic.incrementalAt < graphic.attribute.segments.length) {
33546
- drawContext.multiGraphicOptions = {
33547
- startAtIdx: graphic.incrementalAt,
33548
- length: graphic.incremental
33549
- };
33356
+ else {
33550
33357
  this.renderItem(graphic, drawContext);
33551
- graphic.incrementalAt += graphic.incremental;
33552
- await this.waitToNextFrame();
33553
33358
  }
33359
+ resolve(false);
33360
+ return;
33554
33361
  }
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) {
33362
+ yield foreachAsync(group, DefaultAttribute.zIndex, (item, i) => {
33363
+ if (this.status === STATUS.STOP) {
33364
+ return true;
33365
+ }
33366
+ if (item.isContainer) {
33367
+ return false;
33368
+ }
33369
+ if (i < this.currentIdx) {
33370
+ return false;
33371
+ }
33372
+ const frameTail = this.currFrameStartAt + group.incremental;
33373
+ if (i < frameTail) {
33374
+ this.currentIdx = i + 1;
33375
+ this.renderItem(item, drawContext);
33376
+ }
33377
+ if (i === frameTail - 1) {
33378
+ this.currFrameStartAt = this.currentIdx;
33379
+ return this.waitToNextFrame();
33380
+ }
33569
33381
  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
- }
33382
+ });
33383
+ resolve(false);
33384
+ })
33385
+ });
33584
33386
  });
33387
+ this.hooks.completeDraw.call();
33585
33388
  });
33586
- this.hooks.completeDraw.call();
33587
33389
  }
33588
- async waitToNextFrame() {
33589
- return new Promise(resolve => {
33590
- this.global.getRequestAnimationFrame()(() => {
33591
- resolve(false);
33390
+ waitToNextFrame() {
33391
+ return __awaiter(this, void 0, void 0, function* () {
33392
+ return new Promise(resolve => {
33393
+ this.global.getRequestAnimationFrame()(() => {
33394
+ resolve(false);
33395
+ });
33592
33396
  });
33593
33397
  });
33594
33398
  }
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;
33399
+ checkForDraw(drawContext) {
33400
+ return __awaiter(this, void 0, void 0, function* () {
33401
+ let skip = this.rendering;
33402
+ if (drawContext.restartIncremental) {
33403
+ skip = false;
33404
+ yield this.forceStop();
33405
+ this.resetToInit();
33406
+ }
33407
+ return skip;
33408
+ });
33603
33409
  }
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';
33410
+ forceStop() {
33411
+ return __awaiter(this, void 0, void 0, function* () {
33412
+ if (this.rendering) {
33413
+ this.status = STATUS.STOP;
33414
+ yield new Promise(resolve => {
33415
+ this.hooks.completeDraw.tap('stopCb', () => {
33416
+ this.status = STATUS.NORMAL;
33417
+ this.hooks.completeDraw.taps = this.hooks.completeDraw.taps.filter(item => {
33418
+ return item.name !== 'stopCb';
33419
+ });
33420
+ resolve(false);
33612
33421
  });
33613
- resolve(false);
33614
33422
  });
33615
- });
33616
- }
33423
+ }
33424
+ });
33617
33425
  }
33618
33426
  resetToInit() {
33619
33427
  this.currFrameStartAt = 0;
33620
33428
  this.currentIdx = 0;
33621
33429
  }
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
- }
33430
+ renderGroup(group, drawContext) {
33431
+ return __awaiter(this, void 0, void 0, function* () {
33432
+ if (drawContext.break || group.attribute.visibleAll === false) {
33433
+ return;
33434
+ }
33435
+ if (group.incremental && drawContext.startAtId === group._uid) {
33436
+ yield this._increaseRender(group, drawContext);
33437
+ drawContext.break = true;
33438
+ return;
33439
+ }
33440
+ yield new Promise(resolve => {
33441
+ this.renderItem(group, drawContext, {
33442
+ drawingCb: () => __awaiter(this, void 0, void 0, function* () {
33443
+ yield foreachAsync(group, DefaultAttribute.zIndex, (item) => __awaiter(this, void 0, void 0, function* () {
33444
+ if (drawContext.break) {
33445
+ return;
33446
+ }
33447
+ if (item.isContainer) {
33448
+ yield this.renderGroup(item, drawContext);
33449
+ }
33450
+ else {
33451
+ return;
33452
+ }
33453
+ }));
33454
+ resolve(false);
33455
+ })
33456
+ });
33647
33457
  });
33648
33458
  });
33649
33459
  }
@@ -36186,20 +35996,8 @@
36186
35996
  if (!subLayer || !subLayer.drawContribution) {
36187
35997
  return;
36188
35998
  }
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
- });
35999
+ subLayer.drawContribution.draw(stage.renderService, Object.assign({ x: stage.x, y: stage.y, width: layer.viewWidth, height: layer.viewHeight, stage,
36000
+ layer, clear: 'transparent', renderService: stage.renderService, updateBounds: false, startAtId: group._uid, context: subLayer.layer.getNativeHandler().getContext() }, this.nextUserParams));
36203
36001
  });
36204
36002
  this.nextUserParams = {};
36205
36003
  this.nextFrameRenderGroupSet.clear();
@@ -36512,8 +36310,8 @@
36512
36310
 
36513
36311
  const defaultTicker = new DefaultTicker();
36514
36312
  defaultTicker.addTimeline(defaultTimeline);
36515
- const DEFAULT_TICKER_FPS = 60;
36516
- defaultTicker.setFPS(DEFAULT_TICKER_FPS);
36313
+ const TICKER_FPS = 60;
36314
+ defaultTicker.setFPS(TICKER_FPS);
36517
36315
 
36518
36316
  class DirectionalLight {
36519
36317
  constructor(dir, color, ambient = 0.8) {
@@ -36697,16 +36495,13 @@
36697
36495
  }
36698
36496
  get3dOptions(options) {
36699
36497
  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,
36498
+ return Object.assign(Object.assign({}, options), { center,
36703
36499
  light,
36704
36500
  alpha,
36705
36501
  beta,
36706
36502
  camera,
36707
36503
  fieldRatio,
36708
- fieldDepth
36709
- };
36504
+ fieldDepth });
36710
36505
  }
36711
36506
  set3dOptions(options) {
36712
36507
  var _a, _b, _c, _d, _e, _f;
@@ -36893,7 +36688,7 @@
36893
36688
  renderService: this.renderService,
36894
36689
  background: layer === this.defaultLayer ? this.background : undefined,
36895
36690
  updateBounds: !!this.dirtyBounds
36896
- }, { renderStyle: this.renderStyle, ...params });
36691
+ }, Object.assign({ renderStyle: this.renderStyle }, params));
36897
36692
  });
36898
36693
  this.combineLayersToWindow();
36899
36694
  this.nextFrameRenderLayerSet.clear();
@@ -36936,7 +36731,7 @@
36936
36731
  renderService: this.renderService,
36937
36732
  background: layer === this.defaultLayer ? this.background : undefined,
36938
36733
  updateBounds: !!this.dirtyBounds
36939
- }, { renderStyle: this.renderStyle, ...(this.lastRenderparams || {}) });
36734
+ }, Object.assign({ renderStyle: this.renderStyle }, (this.lastRenderparams || {})));
36940
36735
  }
36941
36736
  });
36942
36737
  this.combineLayersToWindow();
@@ -36964,7 +36759,7 @@
36964
36759
  this.forEachChildren(c => {
36965
36760
  c.resizeView(w, h);
36966
36761
  });
36967
- this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });
36762
+ this.camera && (this.camera.params = Object.assign(Object.assign({}, this.camera.params), { right: this.width, bottom: this.height }));
36968
36763
  rerender && this.render();
36969
36764
  }
36970
36765
  setViewBox(x, y, w, h, rerender) {
@@ -37040,13 +36835,7 @@
37040
36835
  }
37041
36836
  renderTo(window, params) {
37042
36837
  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
- });
36838
+ 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
36839
  });
37051
36840
  }
37052
36841
  renderToNewWindow(fullImage = true) {
@@ -37119,7 +36908,7 @@
37119
36908
  'rect'
37120
36909
  ];
37121
36910
 
37122
- const version = "0.14.1";
36911
+ const version = "0.14.2";
37123
36912
 
37124
36913
  exports.ACustomAnimate = ACustomAnimate;
37125
36914
  exports.ARC3D_NUMBER_TYPE = ARC3D_NUMBER_TYPE;