@visactor/vrender 0.17.19-alpha.1 → 0.18.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4278,10 +4278,6 @@
4278
4278
  var defined0 = !1;
4279
4279
  for (var i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
4280
4280
  }
4281
- function genSegContext(curveType, direction, points) {
4282
- var curveDirection = null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN;
4283
- return "monotoneY" === curveType ? new ReflectSegContext(curveType, curveDirection) : new SegContext(curveType, curveDirection);
4284
- }
4285
4281
 
4286
4282
  var Linear = /*#__PURE__*/function () {
4287
4283
  function Linear(context, startPoint) {
@@ -4337,7 +4333,7 @@
4337
4333
  var direction = params.direction,
4338
4334
  startPoint = params.startPoint;
4339
4335
  if (points.length < 2 - Number(!!startPoint)) return null;
4340
- var segContext = genSegContext("linear", direction, points);
4336
+ var segContext = new SegContext("linear", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
4341
4337
  return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
4342
4338
  }
4343
4339
  function genLinearTypeSegments(path, points) {
@@ -4407,7 +4403,7 @@
4407
4403
  startPoint = params.startPoint;
4408
4404
  if (points.length < 2 - Number(!!startPoint)) return null;
4409
4405
  if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
4410
- var segContext = genSegContext("basis", direction, points);
4406
+ var segContext = new SegContext("basis", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
4411
4407
  return genBasisTypeSegments(new Basis(segContext, startPoint), points), segContext;
4412
4408
  }
4413
4409
 
@@ -4514,7 +4510,7 @@
4514
4510
  }]);
4515
4511
  return MonotoneY;
4516
4512
  }(MonotoneX);
4517
- function genMonotoneXTypeSegments(path, points) {
4513
+ function genMonotpneXTypeSegments(path, points) {
4518
4514
  return genCurveSegments(path, points);
4519
4515
  }
4520
4516
  function genMonotoneXSegments(points) {
@@ -4523,10 +4519,10 @@
4523
4519
  startPoint = params.startPoint;
4524
4520
  if (points.length < 2 - Number(!!startPoint)) return null;
4525
4521
  if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
4526
- var segContext = genSegContext("monotoneX", direction, points);
4527
- return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
4522
+ var segContext = new SegContext("monotoneX", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
4523
+ return genMonotpneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
4528
4524
  }
4529
- function genMonotoneYTypeSegments(path, points) {
4525
+ function genMonotpneYTypeSegments(path, points) {
4530
4526
  return genCurveSegments(path, points);
4531
4527
  }
4532
4528
  function genMonotoneYSegments(points) {
@@ -4535,8 +4531,8 @@
4535
4531
  startPoint = params.startPoint;
4536
4532
  if (points.length < 2 - Number(!!startPoint)) return null;
4537
4533
  if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
4538
- var segContext = genSegContext("monotoneY", direction, points);
4539
- return genMonotoneYTypeSegments(new MonotoneY(segContext, startPoint), points), segContext;
4534
+ var segContext = new ReflectSegContext("monotoneY", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
4535
+ return genMonotpneYTypeSegments(new MonotoneY(segContext, startPoint), points), segContext;
4540
4536
  }
4541
4537
 
4542
4538
  var Step$1 = /*#__PURE__*/function () {
@@ -4605,27 +4601,61 @@
4605
4601
  return genCurveSegments(path, points);
4606
4602
  }
4607
4603
 
4608
- var LinearClosed = /*#__PURE__*/function (_Linear) {
4609
- _inherits(LinearClosed, _Linear);
4610
- var _super = _createSuper(LinearClosed);
4611
- function LinearClosed() {
4604
+ var LinearClosed = /*#__PURE__*/function () {
4605
+ function LinearClosed(context, startPoint) {
4612
4606
  _classCallCheck(this, LinearClosed);
4613
- return _super.apply(this, arguments);
4607
+ this.context = context, startPoint && (this.startPoint = startPoint);
4614
4608
  }
4615
4609
  _createClass(LinearClosed, [{
4610
+ key: "areaStart",
4611
+ value: function areaStart() {
4612
+ this._line = 0;
4613
+ }
4614
+ }, {
4615
+ key: "areaEnd",
4616
+ value: function areaEnd() {
4617
+ this._line = NaN;
4618
+ }
4619
+ }, {
4620
+ key: "lineStart",
4621
+ value: function lineStart() {
4622
+ this._point = 0, this.startPoint && this.point(this.startPoint);
4623
+ }
4624
+ }, {
4616
4625
  key: "lineEnd",
4617
4626
  value: function lineEnd() {
4618
4627
  this.context.closePath();
4619
4628
  }
4629
+ }, {
4630
+ key: "point",
4631
+ value: function point(p) {
4632
+ var x = p.x,
4633
+ y = p.y;
4634
+ switch (this._point) {
4635
+ case 0:
4636
+ this._point = 1, this._line ? this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p) : this.context.moveTo(x, y, p);
4637
+ break;
4638
+ case 1:
4639
+ this._point = 2;
4640
+ default:
4641
+ this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);
4642
+ }
4643
+ this._lastDefined = p.defined;
4644
+ }
4645
+ }, {
4646
+ key: "tryUpdateLength",
4647
+ value: function tryUpdateLength() {
4648
+ return this.context.tryUpdateLength();
4649
+ }
4620
4650
  }]);
4621
4651
  return LinearClosed;
4622
- }(Linear);
4652
+ }();
4623
4653
  function genLinearClosedSegments(points) {
4624
4654
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4625
4655
  var direction = params.direction,
4626
4656
  startPoint = params.startPoint;
4627
4657
  if (points.length < 2 - Number(!!startPoint)) return null;
4628
- var segContext = genSegContext("linear", direction, points);
4658
+ var segContext = new SegContext("linear", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
4629
4659
  return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
4630
4660
  }
4631
4661
  function genLinearClosedTypeSegments(path, points) {
@@ -5158,13 +5188,11 @@
5158
5188
  var DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
5159
5189
  opacity: 1,
5160
5190
  background: null,
5161
- backgroundCornerRadius: 0,
5162
5191
  texture: null,
5163
5192
  textureColor: "black",
5164
5193
  textureSize: 10,
5165
5194
  texturePadding: 2,
5166
5195
  backgroundMode: "no-repeat",
5167
- backgroundFit: !0,
5168
5196
  blur: 0,
5169
5197
  cursor: null,
5170
5198
  html: null
@@ -5182,8 +5210,6 @@
5182
5210
  strokeSeg: null,
5183
5211
  pickable: !0,
5184
5212
  childrenPickable: !0,
5185
- fillPickable: !0,
5186
- strokePickable: !0,
5187
5213
  visible: !0,
5188
5214
  zIndex: 0,
5189
5215
  layout: null,
@@ -6977,10 +7003,7 @@
6977
7003
  value: function removeAllChild() {
6978
7004
  if (!this._idMap) return;
6979
7005
  var child = this._firstChild;
6980
- for (; child;) {
6981
- var next = child._next;
6982
- child.parent = null, child._prev = null, child._next = null, child = next;
6983
- }
7006
+ for (; child;) child.parent = null, child._prev = null, child._next = null, child = child._next;
6984
7007
  this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
6985
7008
  }
6986
7009
  }, {
@@ -7863,14 +7886,10 @@
7863
7886
  viewport = params.viewport,
7864
7887
  _params$autoPreventDe = params.autoPreventDefault,
7865
7888
  autoPreventDefault = _params$autoPreventDe === void 0 ? !1 : _params$autoPreventDe,
7866
- clickInterval = params.clickInterval,
7867
- _params$supportsTouch = params.supportsTouchEvents,
7868
- supportsTouchEvents = _params$supportsTouch === void 0 ? global.supportsTouchEvents : _params$supportsTouch,
7869
- _params$supportsPoint = params.supportsPointerEvents,
7870
- supportsPointerEvents = _params$supportsPoint === void 0 ? global.supportsPointerEvents : _params$supportsPoint;
7889
+ clickInterval = params.clickInterval;
7871
7890
  this.manager = new EventManager(rootNode, {
7872
7891
  clickInterval: clickInterval
7873
- }), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.viewport = viewport, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
7892
+ }), this.globalObj = global, this.supportsPointerEvents = global.supportsPointerEvents, this.supportsTouchEvents = global.supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.viewport = viewport, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
7874
7893
  "default": "inherit",
7875
7894
  pointer: "pointer"
7876
7895
  }, this.resolution = resolution, this.setTargetElement(targetElement);
@@ -10564,25 +10583,6 @@
10564
10583
  return path;
10565
10584
  }
10566
10585
 
10567
- var normalizeRectAttributes = function normalizeRectAttributes(attribute) {
10568
- if (!attribute) return {
10569
- x: 0,
10570
- y: 0,
10571
- width: 0,
10572
- height: 0
10573
- };
10574
- var width = isNil$1(attribute.width) ? attribute.x1 - attribute.x : attribute.width,
10575
- height = isNil$1(attribute.height) ? attribute.y1 - attribute.y : attribute.height,
10576
- x = 0,
10577
- y = 0;
10578
- return width < 0 ? (x = width, width = -width) : Number.isNaN(width) && (width = 0), height < 0 ? (y = height, height = -height) : Number.isNaN(height) && (height = 0), {
10579
- x: x,
10580
- y: y,
10581
- width: width,
10582
- height: height
10583
- };
10584
- };
10585
-
10586
10586
  function splitToGrids(width, height, count) {
10587
10587
  var ratio = width / height;
10588
10588
  var rowCount, columnCount;
@@ -10594,9 +10594,8 @@
10594
10594
  return grids;
10595
10595
  }
10596
10596
  var splitRect = function splitRect(rect, count) {
10597
- var _normalizeRectAttribu = normalizeRectAttributes(rect.attribute),
10598
- width = _normalizeRectAttribu.width,
10599
- height = _normalizeRectAttribu.height,
10597
+ var width = rect.getComputedAttribute("width"),
10598
+ height = rect.getComputedAttribute("height"),
10600
10599
  grids = splitToGrids(width, height, count),
10601
10600
  res = [],
10602
10601
  gridHeight = height / grids.length;
@@ -11364,7 +11363,15 @@
11364
11363
  var data = ResourceLoader.cache.get(url);
11365
11364
  data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(function () {
11366
11365
  mark.imageLoadFail(url);
11367
- }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : ResourceLoader.loadImage(url, mark);
11366
+ }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (data = {
11367
+ type: "image",
11368
+ loadState: "init"
11369
+ }, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(function (res) {
11370
+ var _a;
11371
+ data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map(function (mark, index) {
11372
+ (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
11373
+ });
11374
+ })) : (data.loadState = "fail", mark.imageLoadFail(url)));
11368
11375
  }
11369
11376
  }, {
11370
11377
  key: "GetSvg",
@@ -11398,68 +11405,10 @@
11398
11405
  return data.data;
11399
11406
  }));
11400
11407
  }
11401
- }, {
11402
- key: "loading",
11403
- value: function loading() {
11404
- setTimeout(function () {
11405
- if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
11406
- ResourceLoader.isLoading = !0;
11407
- var tasks = ResourceLoader.toLoadAueue.splice(0, 10),
11408
- promises = [];
11409
- tasks.forEach(function (task) {
11410
- var url = task.url,
11411
- marks = task.marks,
11412
- data = {
11413
- type: "image",
11414
- loadState: "init"
11415
- };
11416
- if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
11417
- data.waitingMark = marks;
11418
- var end = data.dataPromise.then(function (res) {
11419
- var _a;
11420
- data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map(function (mark, index) {
11421
- (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
11422
- });
11423
- });
11424
- promises.push(end);
11425
- } else data.loadState = "fail", marks.forEach(function (mark) {
11426
- return mark.imageLoadFail(url);
11427
- });
11428
- }), Promise.all(promises).then(function () {
11429
- ResourceLoader.isLoading = !1, ResourceLoader.loading();
11430
- })["catch"](function (error) {
11431
- console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
11432
- });
11433
- }
11434
- }, 0);
11435
- }
11436
- }, {
11437
- key: "loadImage",
11438
- value: function loadImage(url, mark) {
11439
- var index = getIndex(url, ResourceLoader.toLoadAueue);
11440
- if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
11441
- ResourceLoader.toLoadAueue.push({
11442
- url: url,
11443
- marks: [mark]
11444
- }), ResourceLoader.loading();
11445
- }
11446
- }, {
11447
- key: "improveImageLoading",
11448
- value: function improveImageLoading(url) {
11449
- var index = getIndex(url, ResourceLoader.toLoadAueue);
11450
- if (-1 !== index) {
11451
- var elememt = ResourceLoader.toLoadAueue.splice(index, 1);
11452
- ResourceLoader.toLoadAueue.unshift(elememt[0]);
11453
- }
11454
- }
11455
11408
  }]);
11456
11409
  return ResourceLoader;
11457
11410
  }();
11458
- function getIndex(url, arr) {
11459
- for (var i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
11460
- return -1;
11461
- }
11462
- ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
11411
+ ResourceLoader.cache = new Map();
11463
11412
 
11464
11413
  var tempMatrix = new Matrix(),
11465
11414
  tempBounds$1 = new AABBBounds();
@@ -11505,8 +11454,7 @@
11505
11454
  var _this;
11506
11455
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
11507
11456
  _classCallCheck(this, Graphic);
11508
- var _a;
11509
- _this = _super.call(this), _this._AABBBounds = new AABBBounds(), _this._updateTag = exports.UpdateTag.INIT, _this.attribute = params, _this.valid = _this.isValid(), params.background && _this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0);
11457
+ _this = _super.call(this), _this._AABBBounds = new AABBBounds(), _this._updateTag = exports.UpdateTag.INIT, _this.attribute = params, _this.valid = _this.isValid(), params.background && _this.loadImage(params.background, !0);
11510
11458
  return _this;
11511
11459
  }
11512
11460
  _createClass(Graphic, [{
@@ -11715,7 +11663,7 @@
11715
11663
  var context = {
11716
11664
  type: exports.AttributeUpdateType.INIT
11717
11665
  };
11718
- params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), this._updateTag = exports.UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
11666
+ params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), this._updateTag = exports.UpdateTag.INIT, this.onAttributeUpdate(context);
11719
11667
  }
11720
11668
  }, {
11721
11669
  key: "translate",
@@ -12245,7 +12193,7 @@
12245
12193
  data: "init",
12246
12194
  state: null
12247
12195
  };
12248
- this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : isObject$1(image) ? (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background) : cache.state = "fail";
12196
+ this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
12249
12197
  }
12250
12198
  }, {
12251
12199
  key: "imageLoadSuccess",
@@ -12819,7 +12767,7 @@
12819
12767
  value: function doUpdateAABBBounds() {
12820
12768
  var attribute = this.attribute,
12821
12769
  groupTheme = getTheme(this).group;
12822
- this._AABBBounds.clear();
12770
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
12823
12771
  var bounds = application.graphicService.updateGroupAABBBounds(attribute, groupTheme, this._AABBBounds, this),
12824
12772
  _attribute$boundsPadd = attribute.boundsPadding,
12825
12773
  boundsPadding = _attribute$boundsPadd === void 0 ? groupTheme.boundsPadding : _attribute$boundsPadd,
@@ -13640,7 +13588,7 @@
13640
13588
  key: "doUpdateAABBBounds",
13641
13589
  value: function doUpdateAABBBounds(full) {
13642
13590
  var circleTheme = getTheme(this).circle;
13643
- this._AABBBounds.clear();
13591
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
13644
13592
  var attribute = this.attribute,
13645
13593
  bounds = application.graphicService.updateCircleAABBBounds(attribute, getTheme(this).circle, this._AABBBounds, full, this),
13646
13594
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -13827,7 +13775,7 @@
13827
13775
  return CanvasTextLayout;
13828
13776
  }();
13829
13777
 
13830
- var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
13778
+ var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
13831
13779
  var Text = /*#__PURE__*/function (_Graphic) {
13832
13780
  _inherits(Text, _Graphic);
13833
13781
  var _super = _createSuper(Text);
@@ -13868,12 +13816,10 @@
13868
13816
  get: function get() {
13869
13817
  var textTheme = getTheme(this).text,
13870
13818
  attribute = this.attribute;
13871
- if (this.isMultiLine) return;
13819
+ if (!this.isSimplify()) return;
13872
13820
  var _attribute$maxLineWid2 = attribute.maxLineWidth,
13873
13821
  maxLineWidth = _attribute$maxLineWid2 === void 0 ? textTheme.maxLineWidth : _attribute$maxLineWid2;
13874
- return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map(function (item) {
13875
- return item.text;
13876
- }).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString());
13822
+ return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), null != this.clipedText && this.clipedText !== attribute.text.toString());
13877
13823
  }
13878
13824
  }, {
13879
13825
  key: "multilineLayout",
@@ -13907,7 +13853,7 @@
13907
13853
  key: "doUpdateAABBBounds",
13908
13854
  value: function doUpdateAABBBounds() {
13909
13855
  var textTheme = getTheme(this).text;
13910
- this._AABBBounds.clear();
13856
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
13911
13857
  var attribute = this.attribute,
13912
13858
  bounds = application.graphicService.updateTextAABBBounds(attribute, textTheme, this._AABBBounds, this),
13913
13859
  _this$attribute$bound = this.attribute.boundsPadding,
@@ -15386,7 +15332,7 @@
15386
15332
  key: "doUpdateAABBBounds",
15387
15333
  value: function doUpdateAABBBounds(full) {
15388
15334
  var symbolTheme = getTheme(this).symbol;
15389
- this._AABBBounds.clear();
15335
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
15390
15336
  var attribute = this.attribute,
15391
15337
  bounds = application.graphicService.updateSymbolAABBBounds(attribute, getTheme(this).symbol, this._AABBBounds, full, this),
15392
15338
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -15476,7 +15422,7 @@
15476
15422
  key: "doUpdateAABBBounds",
15477
15423
  value: function doUpdateAABBBounds() {
15478
15424
  var lineTheme = getTheme(this).line;
15479
- this._AABBBounds.clear();
15425
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
15480
15426
  var attribute = this.attribute,
15481
15427
  bounds = application.graphicService.updateLineAABBBounds(attribute, getTheme(this).line, this._AABBBounds, this),
15482
15428
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -15567,7 +15513,7 @@
15567
15513
  key: "doUpdateAABBBounds",
15568
15514
  value: function doUpdateAABBBounds() {
15569
15515
  var rectTheme = getTheme(this).rect;
15570
- this._AABBBounds.clear();
15516
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
15571
15517
  var attribute = this.attribute,
15572
15518
  bounds = application.graphicService.updateRectAABBBounds(attribute, getTheme(this).rect, this._AABBBounds, this),
15573
15519
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -15598,13 +15544,13 @@
15598
15544
  }, {
15599
15545
  key: "toCustomPath",
15600
15546
  value: function toCustomPath() {
15601
- var attribute = this.attribute,
15602
- _normalizeRectAttribu = normalizeRectAttributes(attribute),
15603
- x = _normalizeRectAttribu.x,
15604
- y = _normalizeRectAttribu.y,
15605
- width = _normalizeRectAttribu.width,
15606
- height = _normalizeRectAttribu.height,
15607
- path = new CustomPath2D();
15547
+ var attribute = this.attribute;
15548
+ var width = isNil$1(attribute.width) ? attribute.x1 - attribute.x : attribute.width,
15549
+ height = isNil$1(attribute.height) ? attribute.y1 - attribute.y : attribute.height,
15550
+ x = 0,
15551
+ y = 0;
15552
+ width < 0 && (x = width, width = -width), height < 0 && (y = height, height = -height);
15553
+ var path = new CustomPath2D();
15608
15554
  return path.moveTo(x, y), path.rect(x, y, width, height), path;
15609
15555
  }
15610
15556
  }, {
@@ -15797,7 +15743,7 @@
15797
15743
  }, {
15798
15744
  key: "doUpdateAABBBounds",
15799
15745
  value: function doUpdateAABBBounds() {
15800
- this._AABBBounds.clear();
15746
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
15801
15747
  var bounds = application.graphicService.updateGlyphAABBBounds(this.attribute, getTheme(this).glyph, this._AABBBounds, this);
15802
15748
  return this.clearUpdateBoundTag(), bounds;
15803
15749
  }
@@ -16169,21 +16115,11 @@
16169
16115
  _this3.failCallback && _this3.failCallback();
16170
16116
  });
16171
16117
  }
16172
- }, {
16173
- key: "setAttributes",
16174
- value: function setAttributes(params, forceUpdateTag, context) {
16175
- return params.image && this.loadImage(params.image), _get(_getPrototypeOf(Image.prototype), "setAttributes", this).call(this, params, forceUpdateTag, context);
16176
- }
16177
- }, {
16178
- key: "setAttribute",
16179
- value: function setAttribute(key, value, forceUpdateTag, context) {
16180
- return "image" === key && this.loadImage(value), _get(_getPrototypeOf(Image.prototype), "setAttribute", this).call(this, key, value, forceUpdateTag, context);
16181
- }
16182
16118
  }, {
16183
16119
  key: "doUpdateAABBBounds",
16184
16120
  value: function doUpdateAABBBounds() {
16185
16121
  var imageTheme = getTheme(this).image;
16186
- this._AABBBounds.clear();
16122
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
16187
16123
  var attribute = this.attribute,
16188
16124
  bounds = application.graphicService.updateImageAABBBounds(attribute, getTheme(this).image, this._AABBBounds, this),
16189
16125
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -16542,7 +16478,7 @@
16542
16478
  key: "doUpdateAABBBounds",
16543
16479
  value: function doUpdateAABBBounds() {
16544
16480
  var richTextTheme = getTheme(this).richtext;
16545
- this._AABBBounds.clear();
16481
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
16546
16482
  var attribute = this.attribute,
16547
16483
  bounds = application.graphicService.updateRichTextAABBBounds(attribute, getTheme(this).richtext, this._AABBBounds, this),
16548
16484
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -16605,13 +16541,10 @@
16605
16541
  _this2.addUpdateBoundTag(), null === (_a = _this2.stage) || void 0 === _a || _a.renderNextFrame();
16606
16542
  }, icon.richtextId = config.id, paragraphs.push(icon);
16607
16543
  }
16608
- } else {
16609
- var richTextConfig = textConfig[i];
16610
- if (isNumber$2(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text.includes("\n")) {
16611
- var textParts = richTextConfig.text.split("\n");
16612
- for (var j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
16613
- } else paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
16614
- }
16544
+ } else if (textConfig[i].text.includes("\n")) {
16545
+ var textParts = textConfig[i].text.split("\n");
16546
+ for (var j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, textConfig[i]));
16547
+ } else paragraphs.push(new Paragraph(textConfig[i].text, !1, textConfig[i]));
16615
16548
  var maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
16616
16549
  maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
16617
16550
  richTextWidthEnable = "number" == typeof width && Number.isFinite(width) && width > 0 && (!maxWidthFinite || width <= maxWidth),
@@ -16730,7 +16663,7 @@
16730
16663
  key: "doUpdateAABBBounds",
16731
16664
  value: function doUpdateAABBBounds() {
16732
16665
  var pathTheme = getTheme(this).path;
16733
- this.doUpdatePathShape(), this._AABBBounds.clear();
16666
+ this.doUpdatePathShape(), this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
16734
16667
  var attribute = this.attribute,
16735
16668
  bounds = application.graphicService.updatePathAABBBounds(attribute, getTheme(this).path, this._AABBBounds, this),
16736
16669
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -16818,7 +16751,7 @@
16818
16751
  key: "doUpdateAABBBounds",
16819
16752
  value: function doUpdateAABBBounds() {
16820
16753
  var areaTheme = getTheme(this).area;
16821
- this._AABBBounds.clear();
16754
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
16822
16755
  var attribute = this.attribute,
16823
16756
  bounds = application.graphicService.updateAreaAABBBounds(attribute, getTheme(this).area, this._AABBBounds, this),
16824
16757
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -17021,7 +16954,7 @@
17021
16954
  key: "doUpdateAABBBounds",
17022
16955
  value: function doUpdateAABBBounds(full) {
17023
16956
  var arcTheme = getTheme(this).arc;
17024
- this._AABBBounds.clear();
16957
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
17025
16958
  var attribute = this.attribute,
17026
16959
  bounds = application.graphicService.updateArcAABBBounds(attribute, getTheme(this).arc, this._AABBBounds, full, this),
17027
16960
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -17107,7 +17040,7 @@
17107
17040
  key: "doUpdateAABBBounds",
17108
17041
  value: function doUpdateAABBBounds() {
17109
17042
  var polygonTheme = getTheme(this).arc;
17110
- this._AABBBounds.clear();
17043
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
17111
17044
  var attribute = this.attribute,
17112
17045
  bounds = application.graphicService.updateArc3dAABBBounds(attribute, getTheme(this).polygon, this._AABBBounds, this),
17113
17046
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -17155,7 +17088,7 @@
17155
17088
  key: "doUpdateAABBBounds",
17156
17089
  value: function doUpdateAABBBounds() {
17157
17090
  var polygonTheme = getTheme(this).polygon;
17158
- this._AABBBounds.clear();
17091
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
17159
17092
  var attribute = this.attribute,
17160
17093
  bounds = application.graphicService.updatePolygonAABBBounds(attribute, getTheme(this).polygon, this._AABBBounds, this),
17161
17094
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -17228,7 +17161,7 @@
17228
17161
  key: "doUpdateAABBBounds",
17229
17162
  value: function doUpdateAABBBounds() {
17230
17163
  var polygonTheme = getTheme(this).polygon;
17231
- this._AABBBounds.clear();
17164
+ this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
17232
17165
  var attribute = this.attribute,
17233
17166
  bounds = application.graphicService.updatePyramid3dAABBBounds(attribute, getTheme(this).polygon, this._AABBBounds, this),
17234
17167
  _attribute$boundsPadd = attribute.boundsPadding,
@@ -18188,37 +18121,35 @@
18188
18121
  }, {
18189
18122
  key: "transformAABBBounds",
18190
18123
  value: function transformAABBBounds(attribute, aabbBounds, theme, miter, graphic) {
18191
- if (!aabbBounds.empty()) {
18192
- var _attribute$scaleX2 = attribute.scaleX,
18193
- scaleX = _attribute$scaleX2 === void 0 ? theme.scaleX : _attribute$scaleX2,
18194
- _attribute$scaleY2 = attribute.scaleY,
18195
- scaleY = _attribute$scaleY2 === void 0 ? theme.scaleY : _attribute$scaleY2,
18196
- _attribute$stroke = attribute.stroke,
18197
- stroke = _attribute$stroke === void 0 ? theme.stroke : _attribute$stroke,
18198
- _attribute$shadowBlur2 = attribute.shadowBlur,
18199
- shadowBlur = _attribute$shadowBlur2 === void 0 ? theme.shadowBlur : _attribute$shadowBlur2,
18200
- _attribute$lineWidth = attribute.lineWidth,
18201
- lineWidth = _attribute$lineWidth === void 0 ? theme.lineWidth : _attribute$lineWidth,
18202
- _attribute$pickStroke = attribute.pickStrokeBuffer,
18203
- pickStrokeBuffer = _attribute$pickStroke === void 0 ? theme.pickStrokeBuffer : _attribute$pickStroke,
18204
- _attribute$strokeBoun2 = attribute.strokeBoundsBuffer,
18205
- strokeBoundsBuffer = _attribute$strokeBoun2 === void 0 ? theme.strokeBoundsBuffer : _attribute$strokeBoun2,
18206
- tb1 = this.tempAABBBounds1,
18207
- tb2 = this.tempAABBBounds2;
18208
- if (stroke && lineWidth) {
18209
- var scaledHalfLineWidth = (lineWidth + pickStrokeBuffer) / Math.abs(scaleX + scaleY);
18210
- boundStroke(tb1, scaledHalfLineWidth, miter, strokeBoundsBuffer), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
18211
- }
18212
- if (shadowBlur) {
18213
- var _attribute$shadowOffs = attribute.shadowOffsetX,
18214
- shadowOffsetX = _attribute$shadowOffs === void 0 ? theme.shadowOffsetX : _attribute$shadowOffs,
18215
- _attribute$shadowOffs2 = attribute.shadowOffsetY,
18216
- shadowOffsetY = _attribute$shadowOffs2 === void 0 ? theme.shadowOffsetY : _attribute$shadowOffs2,
18217
- shadowBlurWidth = shadowBlur / Math.abs(scaleX + scaleY) * 2;
18218
- boundStroke(tb1, shadowBlurWidth, !1, strokeBoundsBuffer + 1), tb1.translate(shadowOffsetX, shadowOffsetY), aabbBounds.union(tb1);
18219
- }
18124
+ var _attribute$scaleX2 = attribute.scaleX,
18125
+ scaleX = _attribute$scaleX2 === void 0 ? theme.scaleX : _attribute$scaleX2,
18126
+ _attribute$scaleY2 = attribute.scaleY,
18127
+ scaleY = _attribute$scaleY2 === void 0 ? theme.scaleY : _attribute$scaleY2,
18128
+ _attribute$stroke = attribute.stroke,
18129
+ stroke = _attribute$stroke === void 0 ? theme.stroke : _attribute$stroke,
18130
+ _attribute$shadowBlur2 = attribute.shadowBlur,
18131
+ shadowBlur = _attribute$shadowBlur2 === void 0 ? theme.shadowBlur : _attribute$shadowBlur2,
18132
+ _attribute$lineWidth = attribute.lineWidth,
18133
+ lineWidth = _attribute$lineWidth === void 0 ? theme.lineWidth : _attribute$lineWidth,
18134
+ _attribute$pickStroke = attribute.pickStrokeBuffer,
18135
+ pickStrokeBuffer = _attribute$pickStroke === void 0 ? theme.pickStrokeBuffer : _attribute$pickStroke,
18136
+ _attribute$strokeBoun2 = attribute.strokeBoundsBuffer,
18137
+ strokeBoundsBuffer = _attribute$strokeBoun2 === void 0 ? theme.strokeBoundsBuffer : _attribute$strokeBoun2,
18138
+ tb1 = this.tempAABBBounds1,
18139
+ tb2 = this.tempAABBBounds2;
18140
+ if (stroke && lineWidth) {
18141
+ var scaledHalfLineWidth = (lineWidth + pickStrokeBuffer) / Math.abs(scaleX + scaleY);
18142
+ boundStroke(tb1, scaledHalfLineWidth, miter, strokeBoundsBuffer), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
18220
18143
  }
18221
- if (this.combindShadowAABBBounds(aabbBounds, graphic), aabbBounds.empty()) return;
18144
+ if (shadowBlur) {
18145
+ var _attribute$shadowOffs = attribute.shadowOffsetX,
18146
+ shadowOffsetX = _attribute$shadowOffs === void 0 ? theme.shadowOffsetX : _attribute$shadowOffs,
18147
+ _attribute$shadowOffs2 = attribute.shadowOffsetY,
18148
+ shadowOffsetY = _attribute$shadowOffs2 === void 0 ? theme.shadowOffsetY : _attribute$shadowOffs2,
18149
+ shadowBlurWidth = shadowBlur / Math.abs(scaleX + scaleY) * 2;
18150
+ boundStroke(tb1, shadowBlurWidth, !1, strokeBoundsBuffer + 1), tb1.translate(shadowOffsetX, shadowOffsetY), aabbBounds.union(tb1);
18151
+ }
18152
+ this.combindShadowAABBBounds(aabbBounds, graphic);
18222
18153
  var updateMatrix = !0;
18223
18154
  var m = graphic.transMatrix;
18224
18155
  graphic && graphic.isContainer && (updateMatrix = !(1 === m.a && 0 === m.b && 0 === m.c && 1 === m.d && 0 === m.e && 0 === m.f)), updateMatrix && transformBoundsWithMatrix(aabbBounds, aabbBounds, m);
@@ -18260,7 +18191,7 @@
18260
18191
 
18261
18192
  var text, richText;
18262
18193
  function getTextBounds(params) {
18263
- return text || (text = graphicCreator.CreateGraphic("text", {})), text.initAttributes(params), text.AABBBounds;
18194
+ return text || (text = graphicCreator.CreateGraphic("text", {})), text.setAttributes(params), text.AABBBounds;
18264
18195
  }
18265
18196
  function getRichTextBounds(params) {
18266
18197
  return richText || (richText = graphicCreator.CreateGraphic("richtext", {})), richText.setAttributes(params), richText.AABBBounds;
@@ -18433,254 +18364,6 @@
18433
18364
  return BaseRender;
18434
18365
  }();
18435
18366
 
18436
- var parse = function () {
18437
- var tokens = {
18438
- linearGradient: /^(linear\-gradient)/i,
18439
- radialGradient: /^(radial\-gradient)/i,
18440
- conicGradient: /^(conic\-gradient)/i,
18441
- sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,
18442
- extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,
18443
- positionKeywords: /^(left|center|right|top|bottom)/i,
18444
- pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
18445
- percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
18446
- emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
18447
- angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
18448
- fromAngleValue: /^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
18449
- startCall: /^\(/,
18450
- endCall: /^\)/,
18451
- comma: /^,/,
18452
- hexColor: /(^\#[0-9a-fA-F]+)/,
18453
- literalColor: /^([a-zA-Z]+)/,
18454
- rgbColor: /^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,
18455
- rgbaColor: /^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,
18456
- number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/
18457
- };
18458
- var input = "";
18459
- function error(msg) {
18460
- var err = new Error(input + ": " + msg);
18461
- throw err.source = input, err;
18462
- }
18463
- function getAST() {
18464
- var ast = matchListing(matchDefinition);
18465
- return input.length > 0 && error("Invalid input not EOF"), ast;
18466
- }
18467
- function matchDefinition() {
18468
- return matchGradient("linear", tokens.linearGradient, matchLinearOrientation) || matchGradient("radial", tokens.radialGradient, matchListRadialOrientations) || matchGradient("conic", tokens.conicGradient, matchConicalOrientation);
18469
- }
18470
- function matchGradient(gradientType, pattern, orientationMatcher) {
18471
- return function (pattern, callback) {
18472
- var captures = scan(pattern);
18473
- if (captures) {
18474
- scan(tokens.startCall) || error("Missing (");
18475
- var result = callback(captures);
18476
- return scan(tokens.endCall) || error("Missing )"), result;
18477
- }
18478
- }(pattern, function (captures) {
18479
- var orientation = orientationMatcher();
18480
- return orientation && (scan(tokens.comma) || error("Missing comma before color stops")), {
18481
- type: gradientType,
18482
- orientation: orientation,
18483
- colorStops: matchListing(matchColorStop)
18484
- };
18485
- });
18486
- }
18487
- function matchLinearOrientation() {
18488
- return match("directional", tokens.sideOrCorner, 1) || match("angular", tokens.angleValue, 1);
18489
- }
18490
- function matchConicalOrientation() {
18491
- return match("angular", tokens.fromAngleValue, 1);
18492
- }
18493
- function matchListRadialOrientations() {
18494
- var radialOrientations,
18495
- lookaheadCache,
18496
- radialOrientation = matchRadialOrientation();
18497
- return radialOrientation && (radialOrientations = [], radialOrientations.push(radialOrientation), lookaheadCache = input, scan(tokens.comma) && (radialOrientation = matchRadialOrientation(), radialOrientation ? radialOrientations.push(radialOrientation) : input = lookaheadCache)), radialOrientations;
18498
- }
18499
- function matchRadialOrientation() {
18500
- var radialType = function () {
18501
- var circle = match("shape", /^(circle)/i, 0);
18502
- circle && (circle.style = matchLength() || matchExtentKeyword());
18503
- return circle;
18504
- }() || function () {
18505
- var ellipse = match("shape", /^(ellipse)/i, 0);
18506
- ellipse && (ellipse.style = matchDistance() || matchExtentKeyword());
18507
- return ellipse;
18508
- }();
18509
- if (radialType) radialType.at = matchAtPosition();else {
18510
- var extent = matchExtentKeyword();
18511
- if (extent) {
18512
- radialType = extent;
18513
- var positionAt = matchAtPosition();
18514
- positionAt && (radialType.at = positionAt);
18515
- } else {
18516
- var defaultPosition = matchPositioning();
18517
- defaultPosition && (radialType = {
18518
- type: "default-radial",
18519
- at: defaultPosition
18520
- });
18521
- }
18522
- }
18523
- return radialType;
18524
- }
18525
- function matchExtentKeyword() {
18526
- return match("extent-keyword", tokens.extentKeywords, 1);
18527
- }
18528
- function matchAtPosition() {
18529
- if (match("position", /^at/, 0)) {
18530
- var positioning = matchPositioning();
18531
- return positioning || error("Missing positioning value"), positioning;
18532
- }
18533
- }
18534
- function matchPositioning() {
18535
- var location = {
18536
- x: matchDistance(),
18537
- y: matchDistance()
18538
- };
18539
- if (location.x || location.y) return {
18540
- type: "position",
18541
- value: location
18542
- };
18543
- }
18544
- function matchListing(matcher) {
18545
- var captures = matcher();
18546
- var result = [];
18547
- if (captures) for (result.push(captures); scan(tokens.comma);) captures = matcher(), captures ? result.push(captures) : error("One extra comma");
18548
- return result;
18549
- }
18550
- function matchColorStop() {
18551
- var color = match("hex", tokens.hexColor, 1) || match("rgba", tokens.rgbaColor, 1) || match("rgb", tokens.rgbColor, 1) || match("literal", tokens.literalColor, 0);
18552
- return color || error("Expected color definition"), color.length = matchDistance(), color;
18553
- }
18554
- function matchDistance() {
18555
- return match("%", tokens.percentageValue, 1) || match("position-keyword", tokens.positionKeywords, 1) || matchLength();
18556
- }
18557
- function matchLength() {
18558
- return match("px", tokens.pixelValue, 1) || match("em", tokens.emValue, 1);
18559
- }
18560
- function match(type, pattern, captureIndex) {
18561
- var captures = scan(pattern);
18562
- if (captures) return {
18563
- type: type,
18564
- value: captures[captureIndex]
18565
- };
18566
- }
18567
- function scan(regexp) {
18568
- var blankCaptures = /^[\n\r\t\s]+/.exec(input);
18569
- blankCaptures && consume(blankCaptures[0].length);
18570
- var captures = regexp.exec(input);
18571
- return captures && consume(captures[0].length), captures;
18572
- }
18573
- function consume(size) {
18574
- input = input.substr(size);
18575
- }
18576
- return function (code) {
18577
- return input = code.toString(), getAST();
18578
- };
18579
- }();
18580
- var GradientParser = /*#__PURE__*/function () {
18581
- function GradientParser() {
18582
- _classCallCheck(this, GradientParser);
18583
- }
18584
- _createClass(GradientParser, null, [{
18585
- key: "IsGradient",
18586
- value: function IsGradient(c) {
18587
- return !("string" == typeof c && c.length < 10);
18588
- }
18589
- }, {
18590
- key: "IsGradientStr",
18591
- value: function IsGradientStr(c) {
18592
- return "string" == typeof c && c.length > 10;
18593
- }
18594
- }, {
18595
- key: "Parse",
18596
- value: function Parse(c) {
18597
- if (GradientParser.IsGradientStr(c)) try {
18598
- var datum = parse(c)[0];
18599
- if (datum) {
18600
- if ("linear" === datum.type) return GradientParser.ParseLinear(datum);
18601
- if ("radial" === datum.type) return GradientParser.ParseRadial(datum);
18602
- if ("conic" === datum.type) return GradientParser.ParseConic(datum);
18603
- }
18604
- } catch (err) {
18605
- return c;
18606
- }
18607
- return c;
18608
- }
18609
- }, {
18610
- key: "ParseConic",
18611
- value: function ParseConic(datum) {
18612
- var orientation = datum.orientation,
18613
- _datum$colorStops = datum.colorStops,
18614
- colorStops = _datum$colorStops === void 0 ? [] : _datum$colorStops,
18615
- halfPi = pi / 2,
18616
- sa = parseFloat(orientation.value) / 180 * pi - halfPi;
18617
- return {
18618
- gradient: "conical",
18619
- x: .5,
18620
- y: .5,
18621
- startAngle: sa,
18622
- endAngle: sa + pi2,
18623
- stops: colorStops.map(function (item) {
18624
- return {
18625
- color: item.value,
18626
- offset: parseFloat(item.length.value) / 100
18627
- };
18628
- })
18629
- };
18630
- }
18631
- }, {
18632
- key: "ParseRadial",
18633
- value: function ParseRadial(datum) {
18634
- var _datum$colorStops2 = datum.colorStops,
18635
- colorStops = _datum$colorStops2 === void 0 ? [] : _datum$colorStops2;
18636
- return {
18637
- gradient: "radial",
18638
- x0: .5,
18639
- y0: .5,
18640
- x1: .5,
18641
- y1: .5,
18642
- r0: 0,
18643
- r1: 1,
18644
- stops: colorStops.map(function (item) {
18645
- return {
18646
- color: item.value,
18647
- offset: parseFloat(item.length.value) / 100
18648
- };
18649
- })
18650
- };
18651
- }
18652
- }, {
18653
- key: "ParseLinear",
18654
- value: function ParseLinear(datum) {
18655
- var orientation = datum.orientation,
18656
- _datum$colorStops3 = datum.colorStops,
18657
- colorStops = _datum$colorStops3 === void 0 ? [] : _datum$colorStops3,
18658
- halfPi = pi / 2;
18659
- var angle = "angular" === orientation.type ? parseFloat(orientation.value) / 180 * pi : 0;
18660
- for (; angle < 0;) angle += pi2;
18661
- for (; angle > pi2;) angle -= pi2;
18662
- var x0 = 0,
18663
- y0 = 0,
18664
- x1 = 0,
18665
- y1 = 0;
18666
- return angle < halfPi ? (x0 = 0, y0 = 1, x1 = Math.sin(angle), y1 = Math.cos(angle)) : angle < pi ? (x0 = 0, y0 = 0, x1 = Math.cos(angle - halfPi), y1 = Math.sin(angle - halfPi)) : angle < pi + halfPi ? (x0 = 1, y0 = 0, x1 = x0 - Math.sin(angle - pi), y1 = Math.cos(angle - pi)) : (x0 = 1, x1 = x0 - Math.cos(angle - halfPi - pi), y1 -= Math.sin(angle - halfPi - pi)), {
18667
- gradient: "linear",
18668
- x0: x0,
18669
- y0: y0,
18670
- x1: x1,
18671
- y1: y1,
18672
- stops: colorStops.map(function (item) {
18673
- return {
18674
- color: item.value,
18675
- offset: parseFloat(item.length.value) / 100
18676
- };
18677
- })
18678
- };
18679
- }
18680
- }]);
18681
- return GradientParser;
18682
- }();
18683
-
18684
18367
  function getScaledStroke(context, width, dpr) {
18685
18368
  var strokeWidth = width;
18686
18369
  var _context$currentMatri = context.currentMatrix,
@@ -18696,7 +18379,7 @@
18696
18379
  if (!c || !0 === c) return "black";
18697
18380
  var result, color;
18698
18381
  if (isArray$1(c)) for (var i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
18699
- return color = GradientParser.Parse(color), "string" == typeof color ? color : ("linear" === color.gradient ? result = createLinearGradient(context, color, params, offsetX, offsetY) : "conical" === color.gradient ? result = createConicGradient(context, color, params, offsetX, offsetY) : "radial" === color.gradient && (result = createRadialGradient(context, color, params, offsetX, offsetY)), result || "orange");
18382
+ return "string" == typeof color ? color : ("linear" === color.gradient ? result = createLinearGradient(context, color, params, offsetX, offsetY) : "conical" === color.gradient ? result = createConicGradient(context, color, params, offsetX, offsetY) : "radial" === color.gradient && (result = createRadialGradient(context, color, params, offsetX, offsetY)), result || "orange");
18700
18383
  }
18701
18384
  function createLinearGradient(context, color, params) {
18702
18385
  var offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
@@ -18797,9 +18480,7 @@
18797
18480
  var _graphic$attribute = graphic.attribute,
18798
18481
  background = _graphic$attribute.background,
18799
18482
  _graphic$attribute$ba = _graphic$attribute.backgroundMode,
18800
- backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba,
18801
- _graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
18802
- backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
18483
+ backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba;
18803
18484
  if (background) if (graphic.backgroundImg && graphic.resources) {
18804
18485
  var res = graphic.resources.get(background);
18805
18486
  if ("success" !== res.state || !res.data) return;
@@ -18814,37 +18495,15 @@
18814
18495
  }
18815
18496
  context.clip();
18816
18497
  var b = graphic.AABBBounds;
18817
- context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
18498
+ context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
18818
18499
  } else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
18819
18500
  }
18820
18501
  }, {
18821
18502
  key: "doDrawImage",
18822
- value: function doDrawImage(context, data, b, backgroundMode, backgroundFit) {
18503
+ value: function doDrawImage(context, data, b, backgroundMode) {
18823
18504
  if ("no-repeat" === backgroundMode) context.drawImage(data, b.x1, b.y1, b.width(), b.height());else {
18824
- var targetW = b.width(),
18825
- targetH = b.height();
18826
- var w = targetW,
18827
- h = targetH;
18828
- if (backgroundFit && "repeat" !== backgroundMode && (data.width || data.height)) {
18829
- var resW = data.width,
18830
- resH = data.height;
18831
- if ("repeat-x" === backgroundMode) {
18832
- w = resW * (targetH / resH), h = targetH;
18833
- } else if ("repeat-y" === backgroundMode) {
18834
- h = resH * (targetW / resW), w = targetW;
18835
- }
18836
- var _dpr = context.dpr,
18837
- canvas = canvasAllocate.allocate({
18838
- width: w,
18839
- height: h,
18840
- dpr: _dpr
18841
- }),
18842
- ctx = canvas.getContext("2d");
18843
- ctx && (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, w, h), ctx.drawImage(data, 0, 0, w, h), data = canvas.nativeCanvas), canvasAllocate.free(canvas);
18844
- }
18845
- var dpr = context.dpr,
18846
- pattern = context.createPattern(data, backgroundMode);
18847
- pattern.setTransform && pattern.setTransform(new DOMMatrix([1 / dpr, 0, 0, 1 / dpr, 0, 0])), context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, targetW, targetH), context.translate(-b.x1, -b.y1);
18505
+ var pattern = context.createPattern(data, backgroundMode);
18506
+ context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, b.width(), b.height()), context.translate(-b.x1, -b.y1);
18848
18507
  }
18849
18508
  }
18850
18509
  }]);
@@ -18867,7 +18526,6 @@
18867
18526
  return DefaultBaseInteractiveRenderContribution;
18868
18527
  }();
18869
18528
  exports.DefaultBaseInteractiveRenderContribution = __decorate$1w([injectable(), __param$O(0, inject(ContributionProvider)), __param$O(0, named(InteractiveSubRenderContribution)), __metadata$19("design:paramtypes", [Object])], exports.DefaultBaseInteractiveRenderContribution);
18870
-
18871
18529
  var DefaultBaseTextureRenderContribution = /*#__PURE__*/function () {
18872
18530
  function DefaultBaseTextureRenderContribution() {
18873
18531
  _classCallCheck(this, DefaultBaseTextureRenderContribution);
@@ -18968,20 +18626,16 @@
18968
18626
  key: "drawShape",
18969
18627
  value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
18970
18628
  this.textureMap || this.initTextureMap(context, graphic.stage);
18971
- var _graphic$attribute = graphic.attribute,
18972
- _graphic$attribute$te = _graphic$attribute.texture,
18973
- texture = _graphic$attribute$te === void 0 ? graphicAttribute.texture : _graphic$attribute$te,
18974
- _graphic$attribute$te2 = _graphic$attribute.textureColor,
18975
- textureColor = _graphic$attribute$te2 === void 0 ? graphicAttribute.textureColor : _graphic$attribute$te2,
18976
- _graphic$attribute$te3 = _graphic$attribute.textureSize,
18977
- textureSize = _graphic$attribute$te3 === void 0 ? graphicAttribute.textureSize : _graphic$attribute$te3,
18978
- _graphic$attribute$te4 = _graphic$attribute.texturePadding,
18979
- texturePadding = _graphic$attribute$te4 === void 0 ? graphicAttribute.texturePadding : _graphic$attribute$te4;
18980
- texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
18981
- }
18982
- }, {
18983
- key: "drawTexture",
18984
- value: function drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
18629
+ var _graphic$attribute2 = graphic.attribute,
18630
+ _graphic$attribute2$t = _graphic$attribute2.texture,
18631
+ texture = _graphic$attribute2$t === void 0 ? graphicAttribute.texture : _graphic$attribute2$t,
18632
+ _graphic$attribute2$t2 = _graphic$attribute2.textureColor,
18633
+ textureColor = _graphic$attribute2$t2 === void 0 ? graphicAttribute.textureColor : _graphic$attribute2$t2,
18634
+ _graphic$attribute2$t3 = _graphic$attribute2.textureSize,
18635
+ textureSize = _graphic$attribute2$t3 === void 0 ? graphicAttribute.textureSize : _graphic$attribute2$t3,
18636
+ _graphic$attribute2$t4 = _graphic$attribute2.texturePadding,
18637
+ texturePadding = _graphic$attribute2$t4 === void 0 ? graphicAttribute.texturePadding : _graphic$attribute2$t4;
18638
+ if (!texture) return;
18985
18639
  var pattern = this.textureMap.get(texture);
18986
18640
  if (!pattern) switch (texture) {
18987
18641
  case "circle":
@@ -19168,15 +18822,13 @@
19168
18822
  var _graphic$attribute = graphic.attribute,
19169
18823
  background = _graphic$attribute.background,
19170
18824
  _graphic$attribute$ba = _graphic$attribute.backgroundMode,
19171
- backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba,
19172
- _graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
19173
- backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
18825
+ backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba;
19174
18826
  if (background) if (graphic.backgroundImg && graphic.resources) {
19175
18827
  var res = graphic.resources.get(background);
19176
18828
  if ("success" !== res.state || !res.data) return;
19177
18829
  context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0);
19178
18830
  var b = graphic.AABBBounds;
19179
- this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
18831
+ this.doDrawImage(context, res.data, b, backgroundMode), context.highPerformanceRestore(), context.setTransformForCurrent();
19180
18832
  } else context.highPerformanceSave(), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
19181
18833
  }
19182
18834
  }]);
@@ -19258,9 +18910,7 @@
19258
18910
  var _graphic$attribute = graphic.attribute,
19259
18911
  background = _graphic$attribute.background,
19260
18912
  _graphic$attribute$ba = _graphic$attribute.backgroundMode,
19261
- backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba,
19262
- _graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
19263
- backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
18913
+ backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba;
19264
18914
  if (background) if (graphic.backgroundImg) {
19265
18915
  var res = graphic.resources.get(background);
19266
18916
  if ("success" !== res.state || !res.data) return;
@@ -19274,7 +18924,7 @@
19274
18924
  context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.translate(scrollX, scrollY);
19275
18925
  }
19276
18926
  var b = graphic.AABBBounds;
19277
- this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
18927
+ this.doDrawImage(context, res.data, b, backgroundMode), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
19278
18928
  } else if (isObject$1(background)) {
19279
18929
  var stroke = background.stroke,
19280
18930
  fill = background.fill,
@@ -19501,37 +19151,6 @@
19501
19151
  var defaultSymbolTextureRenderContribution = defaultBaseTextureRenderContribution;
19502
19152
  var defaultSymbolBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
19503
19153
 
19504
- var DefaultAreaTextureRenderContribution = /*#__PURE__*/function (_DefaultBaseTextureRe) {
19505
- _inherits(DefaultAreaTextureRenderContribution, _DefaultBaseTextureRe);
19506
- var _super = _createSuper(DefaultAreaTextureRenderContribution);
19507
- function DefaultAreaTextureRenderContribution() {
19508
- var _this;
19509
- _classCallCheck(this, DefaultAreaTextureRenderContribution);
19510
- _this = _super.apply(this, arguments), _this.time = exports.BaseRenderContributionTime.afterFillStroke;
19511
- return _this;
19512
- }
19513
- _createClass(DefaultAreaTextureRenderContribution, [{
19514
- key: "drawShape",
19515
- value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
19516
- var _a, _b, _c, _d;
19517
- this.textureMap || this.initTextureMap(context, graphic.stage);
19518
- var _ref = options || {},
19519
- _ref$attribute = _ref.attribute,
19520
- attribute = _ref$attribute === void 0 ? graphic.attribute : _ref$attribute,
19521
- _attribute$texture = attribute.texture,
19522
- texture = _attribute$texture === void 0 ? null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList(graphicAttribute, "texture") : _attribute$texture,
19523
- _attribute$textureCol = attribute.textureColor,
19524
- textureColor = _attribute$textureCol === void 0 ? null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList(graphicAttribute, "textureColor") : _attribute$textureCol,
19525
- _attribute$textureSiz = attribute.textureSize,
19526
- textureSize = _attribute$textureSiz === void 0 ? null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList(graphicAttribute, "textureSize") : _attribute$textureSiz,
19527
- _attribute$texturePad = attribute.texturePadding,
19528
- texturePadding = _attribute$texturePad === void 0 ? null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList(graphicAttribute, "texturePadding") : _attribute$texturePad;
19529
- texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
19530
- }
19531
- }]);
19532
- return DefaultAreaTextureRenderContribution;
19533
- }(DefaultBaseTextureRenderContribution);
19534
-
19535
19154
  var __decorate$1u = undefined && undefined.__decorate || function (decorators, target, key, desc) {
19536
19155
  var d,
19537
19156
  c = arguments.length,
@@ -19772,26 +19391,6 @@
19772
19391
  }(BaseRender);
19773
19392
  exports.DefaultCanvasCircleRender = __decorate$1t([injectable(), __param$M(0, inject(ContributionProvider)), __param$M(0, named(CircleRenderContribution)), __metadata$17("design:paramtypes", [Object])], exports.DefaultCanvasCircleRender);
19774
19393
 
19775
- function drawSegItem(ctx, curve, endPercent, params) {
19776
- if (!curve.p1) return;
19777
- var _ref = params || {},
19778
- _ref$offsetX = _ref.offsetX,
19779
- offsetX = _ref$offsetX === void 0 ? 0 : _ref$offsetX,
19780
- _ref$offsetY = _ref.offsetY,
19781
- offsetY = _ref$offsetY === void 0 ? 0 : _ref$offsetY,
19782
- _ref$offsetZ = _ref.offsetZ,
19783
- offsetZ = _ref$offsetZ === void 0 ? 0 : _ref$offsetZ;
19784
- if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
19785
- var _divideCubic = divideCubic(curve, endPercent),
19786
- _divideCubic2 = _slicedToArray(_divideCubic, 1),
19787
- curve1 = _divideCubic2[0];
19788
- ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
19789
- } else {
19790
- var p = curve.getPointAt(endPercent);
19791
- ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
19792
- }
19793
- }
19794
-
19795
19394
  function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
19796
19395
  var _a;
19797
19396
  var _ref = params || {},
@@ -19834,7 +19433,7 @@
19834
19433
  } else _lastCurve = curve;
19835
19434
  });
19836
19435
  } else curves.forEach(function (curve) {
19837
- curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem(path, curve, 1, params), needMoveTo = !1) : needMoveTo = !0;
19436
+ curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$1(path, curve, 1, params), needMoveTo = !1) : needMoveTo = !0;
19838
19437
  });
19839
19438
  return;
19840
19439
  }
@@ -19873,7 +19472,7 @@
19873
19472
  needMoveTo = !0;
19874
19473
  continue;
19875
19474
  }
19876
- needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem(path, curve, min(_p, 1), params), needMoveTo = !1;
19475
+ needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$1(path, curve, min(_p, 1), params), needMoveTo = !1;
19877
19476
  }
19878
19477
  }
19879
19478
  }
@@ -19910,6 +19509,25 @@
19910
19509
  path.lineTo(null !== (_c = startP.x1) && void 0 !== _c ? _c : startP.x, null !== (_d = startP.y1) && void 0 !== _d ? _d : startP.y), path.closePath();
19911
19510
  });
19912
19511
  }
19512
+ function drawSegItem$1(ctx, curve, endPercent, params) {
19513
+ if (!curve.p1) return;
19514
+ var _ref4 = params || {},
19515
+ _ref4$offsetX = _ref4.offsetX,
19516
+ offsetX = _ref4$offsetX === void 0 ? 0 : _ref4$offsetX,
19517
+ _ref4$offsetY = _ref4.offsetY,
19518
+ offsetY = _ref4$offsetY === void 0 ? 0 : _ref4$offsetY,
19519
+ _ref4$offsetZ = _ref4.offsetZ,
19520
+ offsetZ = _ref4$offsetZ === void 0 ? 0 : _ref4$offsetZ;
19521
+ if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
19522
+ var _divideCubic = divideCubic(curve, endPercent),
19523
+ _divideCubic2 = _slicedToArray(_divideCubic, 1),
19524
+ curve1 = _divideCubic2[0];
19525
+ ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
19526
+ } else {
19527
+ var p = curve.getPointAt(endPercent);
19528
+ ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
19529
+ }
19530
+ }
19913
19531
 
19914
19532
  var __decorate$1s = undefined && undefined.__decorate || function (decorators, target, key, desc) {
19915
19533
  var d,
@@ -20217,23 +19835,99 @@
20217
19835
  }
20218
19836
  path.closePath();
20219
19837
  }
19838
+ function drawSegItem(ctx, curve, endPercent, params) {
19839
+ if (!curve.p1) return;
19840
+ var _ref5 = params || {},
19841
+ _ref5$offsetX = _ref5.offsetX,
19842
+ offsetX = _ref5$offsetX === void 0 ? 0 : _ref5$offsetX,
19843
+ _ref5$offsetY = _ref5.offsetY,
19844
+ offsetY = _ref5$offsetY === void 0 ? 0 : _ref5$offsetY,
19845
+ _ref5$offsetZ = _ref5.offsetZ,
19846
+ offsetZ = _ref5$offsetZ === void 0 ? 0 : _ref5$offsetZ;
19847
+ if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
19848
+ var _divideCubic = divideCubic(curve, endPercent),
19849
+ _divideCubic2 = _slicedToArray(_divideCubic, 1),
19850
+ curve1 = _divideCubic2[0];
19851
+ ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
19852
+ } else {
19853
+ var p = curve.getPointAt(endPercent);
19854
+ ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
19855
+ }
19856
+ }
20220
19857
 
20221
- var defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution();
20222
- var defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
20223
-
20224
- var __decorate$1r = undefined && undefined.__decorate || function (decorators, target, key, desc) {
20225
- var d,
20226
- c = arguments.length,
20227
- r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
20228
- if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
20229
- return c > 3 && r && Object.defineProperty(target, key, r), r;
20230
- },
20231
- __metadata$16 = undefined && undefined.__metadata || function (k, v) {
20232
- if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
20233
- },
20234
- __param$L = undefined && undefined.__param || function (paramIndex, decorator) {
20235
- return function (target, key) {
20236
- decorator(target, key, paramIndex);
19858
+ var DefaultAreaTextureRenderContribution = /*#__PURE__*/function (_DefaultBaseTextureRe) {
19859
+ _inherits(DefaultAreaTextureRenderContribution, _DefaultBaseTextureRe);
19860
+ var _super = _createSuper(DefaultAreaTextureRenderContribution);
19861
+ function DefaultAreaTextureRenderContribution() {
19862
+ var _this;
19863
+ _classCallCheck(this, DefaultAreaTextureRenderContribution);
19864
+ _this = _super.apply(this, arguments), _this.time = exports.BaseRenderContributionTime.afterFillStroke;
19865
+ return _this;
19866
+ }
19867
+ _createClass(DefaultAreaTextureRenderContribution, [{
19868
+ key: "drawShape",
19869
+ value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
19870
+ var _a, _b, _c, _d;
19871
+ this.textureMap || this.initTextureMap(context, graphic.stage);
19872
+ var _ref = options || {},
19873
+ _ref$attribute = _ref.attribute,
19874
+ attribute = _ref$attribute === void 0 ? graphic.attribute : _ref$attribute,
19875
+ _attribute$texture = attribute.texture,
19876
+ texture = _attribute$texture === void 0 ? null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList(graphicAttribute, "texture") : _attribute$texture,
19877
+ _attribute$textureCol = attribute.textureColor,
19878
+ textureColor = _attribute$textureCol === void 0 ? null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList(graphicAttribute, "textureColor") : _attribute$textureCol,
19879
+ _attribute$textureSiz = attribute.textureSize,
19880
+ textureSize = _attribute$textureSiz === void 0 ? null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList(graphicAttribute, "textureSize") : _attribute$textureSiz,
19881
+ _attribute$texturePad = attribute.texturePadding,
19882
+ texturePadding = _attribute$texturePad === void 0 ? null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList(graphicAttribute, "texturePadding") : _attribute$texturePad;
19883
+ if (!texture) return;
19884
+ var pattern = this.textureMap.get(texture);
19885
+ if (!pattern) switch (texture) {
19886
+ case "circle":
19887
+ pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
19888
+ break;
19889
+ case "diamond":
19890
+ pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
19891
+ break;
19892
+ case "rect":
19893
+ pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
19894
+ break;
19895
+ case "vertical-line":
19896
+ pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
19897
+ break;
19898
+ case "horizontal-line":
19899
+ pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
19900
+ break;
19901
+ case "bias-lr":
19902
+ pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
19903
+ break;
19904
+ case "bias-rl":
19905
+ pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
19906
+ break;
19907
+ case "grid":
19908
+ pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
19909
+ }
19910
+ pattern && (context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore());
19911
+ }
19912
+ }]);
19913
+ return DefaultAreaTextureRenderContribution;
19914
+ }(DefaultBaseTextureRenderContribution);
19915
+ var defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution();
19916
+ var defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
19917
+
19918
+ var __decorate$1r = undefined && undefined.__decorate || function (decorators, target, key, desc) {
19919
+ var d,
19920
+ c = arguments.length,
19921
+ r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
19922
+ if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
19923
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
19924
+ },
19925
+ __metadata$16 = undefined && undefined.__metadata || function (k, v) {
19926
+ if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
19927
+ },
19928
+ __param$L = undefined && undefined.__param || function (paramIndex, decorator) {
19929
+ return function (target, key) {
19930
+ decorator(target, key, paramIndex);
20237
19931
  };
20238
19932
  };
20239
19933
  function calcLineCache(points, curveType, params) {
@@ -20291,9 +19985,7 @@
20291
19985
  originX = _area$attribute$x === void 0 ? 0 : _area$attribute$x,
20292
19986
  _area$attribute$x2 = _area$attribute.x,
20293
19987
  originY = _area$attribute$x2 === void 0 ? 0 : _area$attribute$x2;
20294
- if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
20295
- attribute: area.attribute
20296
- }), stroke) {
19988
+ if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), stroke) {
20297
19989
  var _area$attribute$strok = area.attribute.stroke,
20298
19990
  _stroke = _area$attribute$strok === void 0 ? areaAttribute && areaAttribute.stroke : _area$attribute$strok;
20299
19991
  if (isArray$1(_stroke) && (_stroke[0] || _stroke[2]) && !1 === _stroke[1]) if (context.beginPath(), _stroke[0]) {
@@ -20310,7 +20002,9 @@
20310
20002
  context.lineTo((null !== (_d = _p3.x1) && void 0 !== _d ? _d : _p3.x) + offsetX, (null !== (_e = _p3.y1) && void 0 !== _e ? _e : _p3.y) + offsetY, z);
20311
20003
  }
20312
20004
  }
20313
- strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
20005
+ context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke(), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
20006
+ attribute: area.attribute
20007
+ });
20314
20008
  }
20315
20009
  }
20316
20010
  }, {
@@ -20735,46 +20429,6 @@
20735
20429
  }(BaseRender);
20736
20430
  exports.DefaultCanvasSymbolRender = __decorate$1o([injectable(), __param$I(0, inject(ContributionProvider)), __param$I(0, named(SymbolRenderContribution)), __metadata$13("design:paramtypes", [Object])], exports.DefaultCanvasSymbolRender);
20737
20431
 
20738
- var DefaultBoundsAllocate = /*#__PURE__*/function () {
20739
- function DefaultBoundsAllocate() {
20740
- _classCallCheck(this, DefaultBoundsAllocate);
20741
- this.pools = [];
20742
- for (var i = 0; i < 10; i++) this.pools.push(new AABBBounds());
20743
- }
20744
- _createClass(DefaultBoundsAllocate, [{
20745
- key: "allocate",
20746
- value: function allocate(x1, y1, x2, y2) {
20747
- if (!this.pools.length) return new AABBBounds().setValue(x1, y1, x2, y2);
20748
- var b = this.pools.pop();
20749
- return b.x1 = x1, b.y1 = y1, b.x2 = x2, b.y2 = y2, b;
20750
- }
20751
- }, {
20752
- key: "allocateByObj",
20753
- value: function allocateByObj(b) {
20754
- if (!this.pools.length) return new AABBBounds(b);
20755
- var _b = this.pools.pop();
20756
- return _b.x1 = b.x1, _b.y1 = b.y1, _b.x2 = b.x2, _b.y2 = b.y2, _b;
20757
- }
20758
- }, {
20759
- key: "free",
20760
- value: function free(b) {
20761
- this.pools.push(b);
20762
- }
20763
- }, {
20764
- key: "length",
20765
- get: function get() {
20766
- return this.pools.length;
20767
- }
20768
- }, {
20769
- key: "release",
20770
- value: function release() {
20771
- this.pools = [];
20772
- }
20773
- }]);
20774
- return DefaultBoundsAllocate;
20775
- }();
20776
- var boundsAllocate = new DefaultBoundsAllocate();
20777
-
20778
20432
  var DefaultTextBackgroundRenderContribution = /*#__PURE__*/function (_DefaultBaseBackgroun) {
20779
20433
  _inherits(DefaultTextBackgroundRenderContribution, _DefaultBaseBackgroun);
20780
20434
  var _super = _createSuper(DefaultTextBackgroundRenderContribution);
@@ -20787,38 +20441,17 @@
20787
20441
  _createClass(DefaultTextBackgroundRenderContribution, [{
20788
20442
  key: "drawShape",
20789
20443
  value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
20790
- var _a, _c, _d, _e, _f, _g, _h, _j, _k, _l;
20791
20444
  var _graphic$attribute = graphic.attribute,
20445
+ background = _graphic$attribute.background,
20792
20446
  _graphic$attribute$ba = _graphic$attribute.backgroundMode,
20793
- backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba,
20794
- _graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
20795
- backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
20796
- var b,
20797
- background = graphic.attribute.background;
20447
+ backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba;
20798
20448
  if (!background) return;
20799
- var shouldReCalBounds = isObject$1(background) && background.background,
20800
- onlyTranslate = graphic.transMatrix.onlyTranslate();
20801
- if (shouldReCalBounds) {
20802
- var _b = graphic.AABBBounds,
20803
- _x = (null !== (_a = background.x) && void 0 !== _a ? _a : _b.x1) + (null !== (_c = background.dx) && void 0 !== _c ? _c : 0),
20804
- _y = (null !== (_d = background.y) && void 0 !== _d ? _d : _b.y1) + (null !== (_e = background.dy) && void 0 !== _e ? _e : 0),
20805
- w = null !== (_f = background.width) && void 0 !== _f ? _f : _b.width(),
20806
- h = null !== (_g = background.height) && void 0 !== _g ? _g : _b.height();
20807
- if (b = boundsAllocate.allocate(_x, _y, _x + w, _y + h), background = background.background, !onlyTranslate) {
20808
- var _w = b.width(),
20809
- _h2 = b.height();
20810
- b.set((null !== (_h = background.x) && void 0 !== _h ? _h : 0) + (null !== (_j = background.dx) && void 0 !== _j ? _j : 0), (null !== (_k = background.y) && void 0 !== _k ? _k : 0) + (null !== (_l = background.dy) && void 0 !== _l ? _l : 0), _w, _h2);
20811
- }
20812
- } else b = graphic.AABBBounds, onlyTranslate || b.set(0, 0, b.width(), b.height());
20449
+ var b = graphic.AABBBounds;
20813
20450
  if (graphic.backgroundImg && graphic.resources) {
20814
20451
  var res = graphic.resources.get(background);
20815
20452
  if ("success" !== res.state || !res.data) return;
20816
- context.highPerformanceSave(), onlyTranslate && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
20817
- } else {
20818
- var backgroundCornerRadius = graphic.attribute.backgroundCornerRadius;
20819
- context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
20820
- }
20821
- shouldReCalBounds && boundsAllocate.free(b);
20453
+ context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), this.doDrawImage(context, res.data, b, backgroundMode), context.highPerformanceRestore(), context.setTransformForCurrent();
20454
+ } else context.highPerformanceSave(), context.fillStyle = background, context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
20822
20455
  }
20823
20456
  }]);
20824
20457
  return DefaultTextBackgroundRenderContribution;
@@ -21252,9 +20885,7 @@
21252
20885
  value: function draw(image, renderService, drawContext) {
21253
20886
  var url = image.attribute.image;
21254
20887
  if (!url || !image.resources) return;
21255
- var res = image.resources.get(url);
21256
- if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
21257
- if ("success" !== res.state) return;
20888
+ if ("success" !== image.resources.get(url).state) return;
21258
20889
  var context = renderService.drawParams.context;
21259
20890
  if (!context) return;
21260
20891
  var imageAttribute = getTheme(image).image;
@@ -21295,332 +20926,97 @@
21295
20926
  },
21296
20927
  __metadata$$ = undefined && undefined.__metadata || function (k, v) {
21297
20928
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
20929
+ },
20930
+ __param$E = undefined && undefined.__param || function (paramIndex, decorator) {
20931
+ return function (target, key) {
20932
+ decorator(target, key, paramIndex);
20933
+ };
21298
20934
  };
21299
- var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
21300
- var tempDirtyBounds = new AABBBounds();
21301
- var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
21302
- function ShadowRootDrawItemInterceptorContribution() {
21303
- _classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
21304
- this.order = 1;
20935
+ var RenderService = Symbol["for"]("RenderService");
20936
+ var BeforeRenderConstribution = Symbol["for"]("BeforeRenderConstribution");
20937
+ exports.DefaultRenderService = /*#__PURE__*/function () {
20938
+ function DefaultRenderService(drawContribution) {
20939
+ _classCallCheck(this, DefaultRenderService);
20940
+ this.drawContribution = drawContribution;
21305
20941
  }
21306
- _createClass(ShadowRootDrawItemInterceptorContribution, [{
21307
- key: "afterDrawItem",
21308
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21309
- return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
20942
+ _createClass(DefaultRenderService, [{
20943
+ key: "prepare",
20944
+ value: function prepare(updateBounds) {
20945
+ var _this = this;
20946
+ updateBounds && this.renderTreeRoots.forEach(function (g) {
20947
+ _this._prepare(g, updateBounds);
20948
+ });
21310
20949
  }
21311
20950
  }, {
21312
- key: "beforeDrawItem",
21313
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21314
- return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
20951
+ key: "_prepare",
20952
+ value: function _prepare(g, updateBounds) {
20953
+ var _this2 = this;
20954
+ g.forEachChildren(function (g) {
20955
+ _this2._prepare(g, updateBounds);
20956
+ }), g.update({
20957
+ bounds: updateBounds,
20958
+ trans: !0
20959
+ });
21315
20960
  }
21316
20961
  }, {
21317
- key: "drawItem",
21318
- value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21319
- if (!graphic.shadowRoot) return !1;
21320
- var context = drawContext.context;
21321
- if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
21322
- tempDirtyBounds.copy(drawContribution.dirtyBounds);
21323
- var m = graphic.globalTransMatrix.getInverse();
21324
- drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
21325
- }
21326
- return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
20962
+ key: "prepareRenderList",
20963
+ value: function prepareRenderList() {}
20964
+ }, {
20965
+ key: "beforeDraw",
20966
+ value: function beforeDraw(params) {}
20967
+ }, {
20968
+ key: "draw",
20969
+ value: function draw(params) {
20970
+ this.drawContribution.draw(this, Object.assign({}, this.drawParams));
21327
20971
  }
21328
- }]);
21329
- return ShadowRootDrawItemInterceptorContribution;
21330
- }();
21331
- var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
21332
- function DebugDrawItemInterceptorContribution() {
21333
- _classCallCheck(this, DebugDrawItemInterceptorContribution);
21334
- this.order = 1;
21335
- }
21336
- _createClass(DebugDrawItemInterceptorContribution, [{
21337
- key: "afterDrawItem",
21338
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21339
- return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
20972
+ }, {
20973
+ key: "afterDraw",
20974
+ value: function afterDraw(params) {
20975
+ this.drawContribution.afterDraw && this.drawContribution.afterDraw(this, Object.assign({}, this.drawParams));
21340
20976
  }
21341
20977
  }, {
21342
- key: "drawItem",
21343
- value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21344
- if (!graphic.attribute._debug_bounds) return !1;
21345
- var context = drawContext.context;
21346
- context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
21347
- var b = graphic.AABBBounds;
21348
- return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
20978
+ key: "render",
20979
+ value: function render(groups, params) {
20980
+ this.renderTreeRoots = groups, this.drawParams = params;
20981
+ var updateBounds = params.updateBounds;
20982
+ this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params);
21349
20983
  }
21350
20984
  }]);
21351
- return DebugDrawItemInterceptorContribution;
20985
+ return DefaultRenderService;
21352
20986
  }();
21353
- exports.CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
21354
- function CommonDrawItemInterceptorContribution() {
21355
- _classCallCheck(this, CommonDrawItemInterceptorContribution);
21356
- this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
20987
+ exports.DefaultRenderService = __decorate$1j([injectable(), __param$E(0, inject(DrawContribution)), __metadata$$("design:paramtypes", [Object])], exports.DefaultRenderService);
20988
+
20989
+ var renderModule$1 = new ContainerModule(function (bind) {
20990
+ bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
20991
+ });
20992
+
20993
+ var GraphicPicker = Symbol["for"]("GraphicPicker");
20994
+ var PickerService = Symbol["for"]("PickerService");
20995
+ var BoundsPicker = Symbol["for"]("BoundsPicker");
20996
+ var GlobalPickerService = Symbol["for"]("GlobalPickerService");
20997
+
20998
+ var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
20999
+ var d,
21000
+ c = arguments.length,
21001
+ r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21002
+ if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21003
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
21004
+ };
21005
+ var PickItemInterceptor = Symbol["for"]("PickItemInterceptor");
21006
+ exports.ShadowRootPickItemInterceptorContribution = /*#__PURE__*/function () {
21007
+ function ShadowRootPickItemInterceptorContribution() {
21008
+ _classCallCheck(this, ShadowRootPickItemInterceptorContribution);
21009
+ this.order = 1;
21357
21010
  }
21358
- _createClass(CommonDrawItemInterceptorContribution, [{
21359
- key: "afterDrawItem",
21360
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21361
- for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21362
- return !1;
21011
+ _createClass(ShadowRootPickItemInterceptorContribution, [{
21012
+ key: "afterPickItem",
21013
+ value: function afterPickItem(graphic, pickerService, point, pickParams, params) {
21014
+ return graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
21363
21015
  }
21364
21016
  }, {
21365
- key: "beforeDrawItem",
21366
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21367
- if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
21368
- for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21369
- return !1;
21370
- }
21371
- }]);
21372
- return CommonDrawItemInterceptorContribution;
21373
- }();
21374
- exports.CommonDrawItemInterceptorContribution = __decorate$1j([injectable(), __metadata$$("design:paramtypes", [])], exports.CommonDrawItemInterceptorContribution);
21375
- var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
21376
- function InteractiveDrawItemInterceptorContribution() {
21377
- _classCallCheck(this, InteractiveDrawItemInterceptorContribution);
21378
- this.order = 1;
21379
- }
21380
- _createClass(InteractiveDrawItemInterceptorContribution, [{
21381
- key: "beforeDrawItem",
21382
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21383
- return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
21384
- }
21385
- }, {
21386
- key: "beforeSetInteractive",
21387
- value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
21388
- var interactiveGraphic = graphic.interactiveGraphic;
21389
- if (graphic.attribute.globalZIndex) {
21390
- interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
21391
- globalZIndex: 0,
21392
- zIndex: graphic.attribute.globalZIndex
21393
- }, !1, {
21394
- skipUpdateCallback: !0
21395
- }), drawContext.stage.tryInitInteractiveLayer();
21396
- var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21397
- if (interactiveLayer) {
21398
- this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
21399
- }
21400
- return !0;
21401
- }
21402
- if (interactiveGraphic) {
21403
- drawContext.stage.tryInitInteractiveLayer();
21404
- var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21405
- if (_interactiveLayer) {
21406
- this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
21407
- }
21408
- graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
21409
- }
21410
- return !1;
21411
- }
21412
- }, {
21413
- key: "beforeDrawInteractive",
21414
- value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
21415
- var baseGraphic = graphic.baseGraphic;
21416
- if (baseGraphic) {
21417
- this.processing = !0;
21418
- var context = drawContext.context;
21419
- return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
21420
- }
21421
- return !1;
21422
- }
21423
- }, {
21424
- key: "getShadowRoot",
21425
- value: function getShadowRoot(interactiveLayer) {
21426
- var _a;
21427
- var group = interactiveLayer.getElementById("_interactive_group");
21428
- return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
21429
- }
21430
- }]);
21431
- return InteractiveDrawItemInterceptorContribution;
21432
- }();
21433
- var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
21434
- function Canvas3DDrawItemInterceptor() {
21435
- _classCallCheck(this, Canvas3DDrawItemInterceptor);
21436
- this.order = 1;
21437
- }
21438
- _createClass(Canvas3DDrawItemInterceptor, [{
21439
- key: "beforeDrawItem",
21440
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21441
- if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
21442
- drawContext.in3dInterceptor = !0;
21443
- var _renderService$drawPa = renderService.drawParams,
21444
- context = _renderService$drawPa.context,
21445
- stage = _renderService$drawPa.stage;
21446
- context.canvas;
21447
- context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
21448
- var m = context.currentMatrix;
21449
- m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
21450
- var matrix = mat4Allocate.allocate();
21451
- mat3Tomat4(matrix, m);
21452
- var lastModelMatrix = context.modelMatrix;
21453
- if (lastModelMatrix) {
21454
- if (matrix) {
21455
- var _m = mat4Allocate.allocate();
21456
- context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
21457
- }
21458
- } else context.modelMatrix = matrix;
21459
- if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
21460
- var isPie = !1,
21461
- is3d = !1;
21462
- if (graphic.forEachChildren(function (c) {
21463
- return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
21464
- }), graphic.forEachChildren(function (c) {
21465
- return is3d = !!c.findFace, !is3d;
21466
- }), isPie) {
21467
- var children = graphic.getChildren(),
21468
- sortedChildren = _toConsumableArray(children);
21469
- sortedChildren.sort(function (a, b) {
21470
- var _a, _b, _c, _d;
21471
- var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
21472
- angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
21473
- for (; angle1 < 0;) angle1 += pi2;
21474
- for (; angle2 < 0;) angle2 += pi2;
21475
- return angle2 - angle1;
21476
- }), sortedChildren.forEach(function (c) {
21477
- c._next = null, c._prev = null;
21478
- }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
21479
- graphic.appendChild(c);
21480
- });
21481
- var _m2 = graphic.parent.globalTransMatrix;
21482
- drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, _m2), graphic.removeAllChild(), children.forEach(function (c) {
21483
- c._next = null, c._prev = null;
21484
- }), children.forEach(function (c) {
21485
- graphic.appendChild(c);
21486
- });
21487
- } else if (is3d) {
21488
- var _children = graphic.getChildren(),
21489
- zChildren = _children.map(function (g) {
21490
- return {
21491
- ave_z: g.findFace().vertices.map(function (v) {
21492
- var _a;
21493
- return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
21494
- }).reduce(function (a, b) {
21495
- return a + b;
21496
- }, 0),
21497
- g: g
21498
- };
21499
- });
21500
- zChildren.sort(function (a, b) {
21501
- return b.ave_z - a.ave_z;
21502
- }), graphic.removeAllChild(), zChildren.forEach(function (i) {
21503
- i.g._next = null, i.g._prev = null;
21504
- }), graphic.update(), zChildren.forEach(function (i) {
21505
- graphic.add(i.g);
21506
- }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
21507
- g._next = null, g._prev = null;
21508
- }), graphic.update(), _children.forEach(function (g) {
21509
- graphic.add(g);
21510
- });
21511
- } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
21512
- } else drawContribution.renderItem(graphic, drawContext);
21513
- return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
21514
- }
21515
- }, {
21516
- key: "initCanvasCtx",
21517
- value: function initCanvasCtx(context) {
21518
- context.setTransformForCurrent();
21519
- }
21520
- }]);
21521
- return Canvas3DDrawItemInterceptor;
21522
- }();
21523
-
21524
- var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21525
- var d,
21526
- c = arguments.length,
21527
- r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21528
- if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21529
- return c > 3 && r && Object.defineProperty(target, key, r), r;
21530
- },
21531
- __metadata$_ = undefined && undefined.__metadata || function (k, v) {
21532
- if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21533
- },
21534
- __param$E = undefined && undefined.__param || function (paramIndex, decorator) {
21535
- return function (target, key) {
21536
- decorator(target, key, paramIndex);
21537
- };
21538
- };
21539
- var RenderService = Symbol["for"]("RenderService");
21540
- var BeforeRenderConstribution = Symbol["for"]("BeforeRenderConstribution");
21541
- exports.DefaultRenderService = /*#__PURE__*/function () {
21542
- function DefaultRenderService(drawContribution) {
21543
- _classCallCheck(this, DefaultRenderService);
21544
- this.drawContribution = drawContribution;
21545
- }
21546
- _createClass(DefaultRenderService, [{
21547
- key: "prepare",
21548
- value: function prepare(updateBounds) {
21549
- var _this = this;
21550
- updateBounds && this.renderTreeRoots.forEach(function (g) {
21551
- _this._prepare(g, updateBounds);
21552
- });
21553
- }
21554
- }, {
21555
- key: "_prepare",
21556
- value: function _prepare(g, updateBounds) {
21557
- var _this2 = this;
21558
- g.forEachChildren(function (g) {
21559
- _this2._prepare(g, updateBounds);
21560
- }), g.update({
21561
- bounds: updateBounds,
21562
- trans: !0
21563
- });
21564
- }
21565
- }, {
21566
- key: "prepareRenderList",
21567
- value: function prepareRenderList() {}
21568
- }, {
21569
- key: "beforeDraw",
21570
- value: function beforeDraw(params) {}
21571
- }, {
21572
- key: "draw",
21573
- value: function draw(params) {
21574
- this.drawContribution.draw(this, Object.assign({}, this.drawParams));
21575
- }
21576
- }, {
21577
- key: "afterDraw",
21578
- value: function afterDraw(params) {
21579
- this.drawContribution.afterDraw && this.drawContribution.afterDraw(this, Object.assign({}, this.drawParams));
21580
- }
21581
- }, {
21582
- key: "render",
21583
- value: function render(groups, params) {
21584
- this.renderTreeRoots = groups, this.drawParams = params;
21585
- var updateBounds = params.updateBounds;
21586
- this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params);
21587
- }
21588
- }]);
21589
- return DefaultRenderService;
21590
- }();
21591
- exports.DefaultRenderService = __decorate$1i([injectable(), __param$E(0, inject(DrawContribution)), __metadata$_("design:paramtypes", [Object])], exports.DefaultRenderService);
21592
-
21593
- var renderModule$1 = new ContainerModule(function (bind) {
21594
- bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
21595
- });
21596
-
21597
- var GraphicPicker = Symbol["for"]("GraphicPicker");
21598
- var PickerService = Symbol["for"]("PickerService");
21599
- var BoundsPicker = Symbol["for"]("BoundsPicker");
21600
- var GlobalPickerService = Symbol["for"]("GlobalPickerService");
21601
-
21602
- var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21603
- var d,
21604
- c = arguments.length,
21605
- r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21606
- if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21607
- return c > 3 && r && Object.defineProperty(target, key, r), r;
21608
- };
21609
- var PickItemInterceptor = Symbol["for"]("PickItemInterceptor");
21610
- exports.ShadowRootPickItemInterceptorContribution = /*#__PURE__*/function () {
21611
- function ShadowRootPickItemInterceptorContribution() {
21612
- _classCallCheck(this, ShadowRootPickItemInterceptorContribution);
21613
- this.order = 1;
21614
- }
21615
- _createClass(ShadowRootPickItemInterceptorContribution, [{
21616
- key: "afterPickItem",
21617
- value: function afterPickItem(graphic, pickerService, point, pickParams, params) {
21618
- return graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
21619
- }
21620
- }, {
21621
- key: "beforePickItem",
21622
- value: function beforePickItem(graphic, pickerService, point, pickParams, params) {
21623
- return graphic.attribute.shadowRootIdx < 0 ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
21017
+ key: "beforePickItem",
21018
+ value: function beforePickItem(graphic, pickerService, point, pickParams, params) {
21019
+ return graphic.attribute.shadowRootIdx < 0 ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
21624
21020
  }
21625
21021
  }, {
21626
21022
  key: "_pickItem",
@@ -21640,7 +21036,7 @@
21640
21036
  }]);
21641
21037
  return ShadowRootPickItemInterceptorContribution;
21642
21038
  }();
21643
- exports.ShadowRootPickItemInterceptorContribution = __decorate$1h([injectable()], exports.ShadowRootPickItemInterceptorContribution);
21039
+ exports.ShadowRootPickItemInterceptorContribution = __decorate$1i([injectable()], exports.ShadowRootPickItemInterceptorContribution);
21644
21040
  exports.InteractivePickItemInterceptorContribution = /*#__PURE__*/function () {
21645
21041
  function InteractivePickItemInterceptorContribution() {
21646
21042
  _classCallCheck(this, InteractivePickItemInterceptorContribution);
@@ -21664,7 +21060,7 @@
21664
21060
  }]);
21665
21061
  return InteractivePickItemInterceptorContribution;
21666
21062
  }();
21667
- exports.InteractivePickItemInterceptorContribution = __decorate$1h([injectable()], exports.InteractivePickItemInterceptorContribution);
21063
+ exports.InteractivePickItemInterceptorContribution = __decorate$1i([injectable()], exports.InteractivePickItemInterceptorContribution);
21668
21064
  exports.Canvas3DPickItemInterceptor = /*#__PURE__*/function () {
21669
21065
  function Canvas3DPickItemInterceptor() {
21670
21066
  _classCallCheck(this, Canvas3DPickItemInterceptor);
@@ -21741,7 +21137,7 @@
21741
21137
  }]);
21742
21138
  return Canvas3DPickItemInterceptor;
21743
21139
  }();
21744
- exports.Canvas3DPickItemInterceptor = __decorate$1h([injectable()], exports.Canvas3DPickItemInterceptor);
21140
+ exports.Canvas3DPickItemInterceptor = __decorate$1i([injectable()], exports.Canvas3DPickItemInterceptor);
21745
21141
 
21746
21142
  var pickModule = new ContainerModule(function (bind, unbind, isBound) {
21747
21143
  isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(exports.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.Canvas3DPickItemInterceptor), bind(exports.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.ShadowRootPickItemInterceptorContribution), bind(exports.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(exports.InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
@@ -21754,14 +21150,14 @@
21754
21150
  var AutoEnablePlugins = Symbol["for"]("AutoEnablePlugins");
21755
21151
  var PluginService = Symbol["for"]("PluginService");
21756
21152
 
21757
- var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21153
+ var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21758
21154
  var d,
21759
21155
  c = arguments.length,
21760
21156
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21761
21157
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21762
21158
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21763
21159
  },
21764
- __metadata$Z = undefined && undefined.__metadata || function (k, v) {
21160
+ __metadata$_ = undefined && undefined.__metadata || function (k, v) {
21765
21161
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21766
21162
  },
21767
21163
  __param$D = undefined && undefined.__param || function (paramIndex, decorator) {
@@ -21817,7 +21213,7 @@
21817
21213
  }]);
21818
21214
  return DefaultPluginService;
21819
21215
  }();
21820
- DefaultPluginService = __decorate$1g([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$Z("design:paramtypes", [Object])], DefaultPluginService);
21216
+ DefaultPluginService = __decorate$1h([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$_("design:paramtypes", [Object])], DefaultPluginService);
21821
21217
 
21822
21218
  var pluginModule = new ContainerModule(function (bind) {
21823
21219
  bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
@@ -21831,14 +21227,14 @@
21831
21227
  bind(TextMeasureContribution).to(exports.DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
21832
21228
  });
21833
21229
 
21834
- var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21230
+ var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21835
21231
  var d,
21836
21232
  c = arguments.length,
21837
21233
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21838
21234
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21839
21235
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21840
21236
  },
21841
- __metadata$Y = undefined && undefined.__metadata || function (k, v) {
21237
+ __metadata$Z = undefined && undefined.__metadata || function (k, v) {
21842
21238
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21843
21239
  };
21844
21240
  var CanvasLayerHandlerContribution = /*#__PURE__*/function () {
@@ -21932,16 +21328,16 @@
21932
21328
  }]);
21933
21329
  return CanvasLayerHandlerContribution;
21934
21330
  }();
21935
- CanvasLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], CanvasLayerHandlerContribution);
21331
+ CanvasLayerHandlerContribution = __decorate$1g([injectable(), __metadata$Z("design:paramtypes", [])], CanvasLayerHandlerContribution);
21936
21332
 
21937
- var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21333
+ var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21938
21334
  var d,
21939
21335
  c = arguments.length,
21940
21336
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21941
21337
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21942
21338
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21943
21339
  },
21944
- __metadata$X = undefined && undefined.__metadata || function (k, v) {
21340
+ __metadata$Y = undefined && undefined.__metadata || function (k, v) {
21945
21341
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21946
21342
  };
21947
21343
  var EmptyLayerHandlerContribution = /*#__PURE__*/function () {
@@ -21999,16 +21395,16 @@
21999
21395
  }]);
22000
21396
  return EmptyLayerHandlerContribution;
22001
21397
  }();
22002
- EmptyLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], EmptyLayerHandlerContribution);
21398
+ EmptyLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], EmptyLayerHandlerContribution);
22003
21399
 
22004
- var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21400
+ var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
22005
21401
  var d,
22006
21402
  c = arguments.length,
22007
21403
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
22008
21404
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
22009
21405
  return c > 3 && r && Object.defineProperty(target, key, r), r;
22010
21406
  },
22011
- __metadata$W = undefined && undefined.__metadata || function (k, v) {
21407
+ __metadata$X = undefined && undefined.__metadata || function (k, v) {
22012
21408
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
22013
21409
  };
22014
21410
  var OffscreenLayerHandlerContribution = /*#__PURE__*/function () {
@@ -22095,7 +21491,7 @@
22095
21491
  }]);
22096
21492
  return OffscreenLayerHandlerContribution;
22097
21493
  }();
22098
- OffscreenLayerHandlerContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], OffscreenLayerHandlerContribution);
21494
+ OffscreenLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], OffscreenLayerHandlerContribution);
22099
21495
 
22100
21496
  var layerHandlerModules = new ContainerModule(function (bind) {
22101
21497
  bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
@@ -22121,106 +21517,381 @@
22121
21517
  reject(e);
22122
21518
  }
22123
21519
  }
22124
- function step(result) {
22125
- var value;
22126
- result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P(function (resolve) {
22127
- resolve(value);
22128
- })).then(fulfilled, rejected);
21520
+ function step(result) {
21521
+ var value;
21522
+ result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P(function (resolve) {
21523
+ resolve(value);
21524
+ })).then(fulfilled, rejected);
21525
+ }
21526
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21527
+ });
21528
+ };
21529
+ function foreach(graphic, defaultZIndex, cb) {
21530
+ var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
21531
+ var sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
21532
+ var childMap = {},
21533
+ zIdxArray = [];
21534
+ var needSort = !1;
21535
+ if (sort3d) needSort = !0;else {
21536
+ var lastZIndex;
21537
+ graphic.forEachChildren(function (item, i) {
21538
+ var _item$attribute$zInde = item.attribute.zIndex,
21539
+ zIndex = _item$attribute$zInde === void 0 ? defaultZIndex : _item$attribute$zInde;
21540
+ if (0 === i) lastZIndex = zIndex;else if (lastZIndex !== zIndex) return needSort = !0, !0;
21541
+ return !1;
21542
+ }, reverse);
21543
+ }
21544
+ if (needSort) {
21545
+ graphic.forEachChildren(function (item) {
21546
+ var _item$attribute$zInde2 = item.attribute.zIndex,
21547
+ zIndex = _item$attribute$zInde2 === void 0 ? defaultZIndex : _item$attribute$zInde2;
21548
+ childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [item], zIdxArray.push(zIndex));
21549
+ }, reverse), zIdxArray.sort(function (a, b) {
21550
+ return reverse ? b - a : a - b;
21551
+ });
21552
+ var skip = !1;
21553
+ for (var i = 0; i < zIdxArray.length && !skip; i++) {
21554
+ var idx = zIdxArray[i],
21555
+ children = childMap[idx];
21556
+ sort3d && children.sort(function (a, b) {
21557
+ var _a, _b;
21558
+ return (reverse ? -1 : 1) * ((null !== (_a = b.attribute.z) && void 0 !== _a ? _a : 0) - (null !== (_b = a.attribute.z) && void 0 !== _b ? _b : 0));
21559
+ });
21560
+ for (var _i = 0; _i < children.length; _i++) if (cb(children[_i], _i)) {
21561
+ skip = !0;
21562
+ break;
21563
+ }
21564
+ }
21565
+ } else graphic.forEachChildren(cb, reverse);
21566
+ }
21567
+ function foreachAsync(graphic, defaultZIndex, cb) {
21568
+ var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
21569
+ return __awaiter$2(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
21570
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
21571
+ while (1) switch (_context.prev = _context.next) {
21572
+ case 0:
21573
+ _context.next = 2;
21574
+ return graphic.forEachChildrenAsync(cb, reverse);
21575
+ case 2:
21576
+ case "end":
21577
+ return _context.stop();
21578
+ }
21579
+ }, _callee);
21580
+ }));
21581
+ }
21582
+ function findNextGraphic(graphic, id, defaultZIndex) {
21583
+ var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
21584
+ var childMap = {},
21585
+ zIdxArray = [];
21586
+ var needSort = !1;
21587
+ graphic.forEachChildren(function (item, i) {
21588
+ var _item$attribute$zInde3 = item.attribute.zIndex,
21589
+ zIndex = _item$attribute$zInde3 === void 0 ? defaultZIndex : _item$attribute$zInde3;
21590
+ if (0 === i) ;else if (undefined !== zIndex) return needSort = !0, !0;
21591
+ return !1;
21592
+ }, reverse);
21593
+ var result = null,
21594
+ next = !1;
21595
+ if (needSort) {
21596
+ graphic.forEachChildren(function (item) {
21597
+ var _item$attribute$zInde4 = item.attribute.zIndex,
21598
+ zIndex = _item$attribute$zInde4 === void 0 ? defaultZIndex : _item$attribute$zInde4;
21599
+ childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [item], zIdxArray.push(zIndex));
21600
+ }, reverse), zIdxArray.sort(function (a, b) {
21601
+ return reverse ? b - a : a - b;
21602
+ });
21603
+ var skip = !1;
21604
+ for (var i = 0; i < zIdxArray.length && !skip; i++) {
21605
+ var idx = zIdxArray[i],
21606
+ children = childMap[idx];
21607
+ for (var _i2 = 0; _i2 < children.length; _i2++) {
21608
+ if (next) {
21609
+ skip = !0, result = children[_i2];
21610
+ break;
21611
+ }
21612
+ children[_i2]._uid !== id || (next = !0);
21613
+ }
21614
+ }
21615
+ } else graphic.forEachChildren(function (item) {
21616
+ return next ? (result = item, !0) : (item._uid === id && (next = !0), !1);
21617
+ }, reverse);
21618
+ return result;
21619
+ }
21620
+
21621
+ var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21622
+ var d,
21623
+ c = arguments.length,
21624
+ r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21625
+ if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21626
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
21627
+ },
21628
+ __metadata$W = undefined && undefined.__metadata || function (k, v) {
21629
+ if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21630
+ };
21631
+ var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
21632
+ var tempDirtyBounds = new AABBBounds();
21633
+ var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
21634
+ function ShadowRootDrawItemInterceptorContribution() {
21635
+ _classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
21636
+ this.order = 1;
21637
+ }
21638
+ _createClass(ShadowRootDrawItemInterceptorContribution, [{
21639
+ key: "afterDrawItem",
21640
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21641
+ return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21642
+ }
21643
+ }, {
21644
+ key: "beforeDrawItem",
21645
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21646
+ return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21647
+ }
21648
+ }, {
21649
+ key: "drawItem",
21650
+ value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21651
+ if (!graphic.shadowRoot) return !1;
21652
+ var context = drawContext.context;
21653
+ if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
21654
+ tempDirtyBounds.copy(drawContribution.dirtyBounds);
21655
+ var m = graphic.globalTransMatrix.getInverse();
21656
+ drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
21657
+ }
21658
+ return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
21659
+ }
21660
+ }]);
21661
+ return ShadowRootDrawItemInterceptorContribution;
21662
+ }();
21663
+ var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
21664
+ function DebugDrawItemInterceptorContribution() {
21665
+ _classCallCheck(this, DebugDrawItemInterceptorContribution);
21666
+ this.order = 1;
21667
+ }
21668
+ _createClass(DebugDrawItemInterceptorContribution, [{
21669
+ key: "afterDrawItem",
21670
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21671
+ return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21672
+ }
21673
+ }, {
21674
+ key: "drawItem",
21675
+ value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21676
+ if (!graphic.attribute._debug_bounds) return !1;
21677
+ var context = drawContext.context;
21678
+ context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
21679
+ var b = graphic.AABBBounds;
21680
+ return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
21681
+ }
21682
+ }]);
21683
+ return DebugDrawItemInterceptorContribution;
21684
+ }();
21685
+ var CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
21686
+ function CommonDrawItemInterceptorContribution() {
21687
+ _classCallCheck(this, CommonDrawItemInterceptorContribution);
21688
+ this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
21689
+ }
21690
+ _createClass(CommonDrawItemInterceptorContribution, [{
21691
+ key: "afterDrawItem",
21692
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21693
+ for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21694
+ return !1;
21695
+ }
21696
+ }, {
21697
+ key: "beforeDrawItem",
21698
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21699
+ if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
21700
+ for (var i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21701
+ return !1;
21702
+ }
21703
+ }]);
21704
+ return CommonDrawItemInterceptorContribution;
21705
+ }();
21706
+ CommonDrawItemInterceptorContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
21707
+ var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
21708
+ function InteractiveDrawItemInterceptorContribution() {
21709
+ _classCallCheck(this, InteractiveDrawItemInterceptorContribution);
21710
+ this.order = 1;
21711
+ }
21712
+ _createClass(InteractiveDrawItemInterceptorContribution, [{
21713
+ key: "beforeDrawItem",
21714
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21715
+ return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
21716
+ }
21717
+ }, {
21718
+ key: "beforeSetInteractive",
21719
+ value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
21720
+ var interactiveGraphic = graphic.interactiveGraphic;
21721
+ if (graphic.attribute.globalZIndex) {
21722
+ interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
21723
+ globalZIndex: 0,
21724
+ zIndex: graphic.attribute.globalZIndex
21725
+ }, !1, {
21726
+ skipUpdateCallback: !0
21727
+ }), drawContext.stage.tryInitInteractiveLayer();
21728
+ var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21729
+ if (interactiveLayer) {
21730
+ this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
21731
+ }
21732
+ return !0;
21733
+ }
21734
+ if (interactiveGraphic) {
21735
+ drawContext.stage.tryInitInteractiveLayer();
21736
+ var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21737
+ if (_interactiveLayer) {
21738
+ this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
21739
+ }
21740
+ graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
21741
+ }
21742
+ return !1;
21743
+ }
21744
+ }, {
21745
+ key: "beforeDrawInteractive",
21746
+ value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
21747
+ var baseGraphic = graphic.baseGraphic;
21748
+ if (baseGraphic) {
21749
+ this.processing = !0;
21750
+ var context = drawContext.context;
21751
+ return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
21752
+ }
21753
+ return !1;
21754
+ }
21755
+ }, {
21756
+ key: "getShadowRoot",
21757
+ value: function getShadowRoot(interactiveLayer) {
21758
+ var _a;
21759
+ var group = interactiveLayer.getElementById("_interactive_group");
21760
+ return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
21761
+ }
21762
+ }]);
21763
+ return InteractiveDrawItemInterceptorContribution;
21764
+ }();
21765
+ var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
21766
+ function Canvas3DDrawItemInterceptor() {
21767
+ _classCallCheck(this, Canvas3DDrawItemInterceptor);
21768
+ this.order = 1;
21769
+ }
21770
+ _createClass(Canvas3DDrawItemInterceptor, [{
21771
+ key: "beforeDrawItem",
21772
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21773
+ if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
21774
+ drawContext.in3dInterceptor = !0;
21775
+ var _renderService$drawPa = renderService.drawParams,
21776
+ context = _renderService$drawPa.context,
21777
+ stage = _renderService$drawPa.stage;
21778
+ context.canvas;
21779
+ context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
21780
+ var m = context.currentMatrix;
21781
+ m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
21782
+ var matrix = mat4Allocate.allocate();
21783
+ mat3Tomat4(matrix, m);
21784
+ var lastModelMatrix = context.modelMatrix;
21785
+ if (lastModelMatrix) {
21786
+ if (matrix) {
21787
+ var _m = mat4Allocate.allocate();
21788
+ context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
21789
+ }
21790
+ } else context.modelMatrix = matrix;
21791
+ if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
21792
+ var isPie = !1,
21793
+ is3d = !1;
21794
+ if (graphic.forEachChildren(function (c) {
21795
+ return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
21796
+ }), graphic.forEachChildren(function (c) {
21797
+ return is3d = !!c.findFace, !is3d;
21798
+ }), isPie) {
21799
+ var children = graphic.getChildren(),
21800
+ sortedChildren = _toConsumableArray(children);
21801
+ sortedChildren.sort(function (a, b) {
21802
+ var _a, _b, _c, _d;
21803
+ var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
21804
+ angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
21805
+ for (; angle1 < 0;) angle1 += pi2;
21806
+ for (; angle2 < 0;) angle2 += pi2;
21807
+ return angle2 - angle1;
21808
+ }), sortedChildren.forEach(function (c) {
21809
+ c._next = null, c._prev = null;
21810
+ }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
21811
+ graphic.appendChild(c);
21812
+ });
21813
+ var _m2 = graphic.parent.globalTransMatrix;
21814
+ drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, _m2), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, _m2), graphic.removeAllChild(), children.forEach(function (c) {
21815
+ c._next = null, c._prev = null;
21816
+ }), children.forEach(function (c) {
21817
+ graphic.appendChild(c);
21818
+ });
21819
+ } else if (is3d) {
21820
+ var _children = graphic.getChildren(),
21821
+ zChildren = _children.map(function (g) {
21822
+ return {
21823
+ ave_z: g.findFace().vertices.map(function (v) {
21824
+ var _a;
21825
+ return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
21826
+ }).reduce(function (a, b) {
21827
+ return a + b;
21828
+ }, 0),
21829
+ g: g
21830
+ };
21831
+ });
21832
+ zChildren.sort(function (a, b) {
21833
+ return b.ave_z - a.ave_z;
21834
+ }), graphic.removeAllChild(), zChildren.forEach(function (i) {
21835
+ i.g._next = null, i.g._prev = null;
21836
+ }), graphic.update(), zChildren.forEach(function (i) {
21837
+ graphic.add(i.g);
21838
+ }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
21839
+ g._next = null, g._prev = null;
21840
+ }), graphic.update(), _children.forEach(function (g) {
21841
+ graphic.add(g);
21842
+ });
21843
+ } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
21844
+ } else drawContribution.renderItem(graphic, drawContext);
21845
+ return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
21846
+ }
21847
+ }, {
21848
+ key: "initCanvasCtx",
21849
+ value: function initCanvasCtx(context) {
21850
+ context.setTransformForCurrent();
21851
+ }
21852
+ }]);
21853
+ return Canvas3DDrawItemInterceptor;
21854
+ }();
21855
+
21856
+ var DefaultBoundsAllocate = /*#__PURE__*/function () {
21857
+ function DefaultBoundsAllocate() {
21858
+ _classCallCheck(this, DefaultBoundsAllocate);
21859
+ this.pools = [];
21860
+ for (var i = 0; i < 10; i++) this.pools.push(new AABBBounds());
21861
+ }
21862
+ _createClass(DefaultBoundsAllocate, [{
21863
+ key: "allocate",
21864
+ value: function allocate(x1, y1, x2, y2) {
21865
+ if (!this.pools.length) return new AABBBounds().setValue(x1, y1, x2, y2);
21866
+ var b = this.pools.pop();
21867
+ return b.x1 = x1, b.y1 = y1, b.x2 = x2, b.y2 = y2, b;
21868
+ }
21869
+ }, {
21870
+ key: "allocateByObj",
21871
+ value: function allocateByObj(b) {
21872
+ if (!this.pools.length) return new AABBBounds(b);
21873
+ var _b = this.pools.pop();
21874
+ return _b.x1 = b.x1, _b.y1 = b.y1, _b.x2 = b.x2, _b.y2 = b.y2, _b;
22129
21875
  }
22130
- step((generator = generator.apply(thisArg, _arguments || [])).next());
22131
- });
22132
- };
22133
- function foreach(graphic, defaultZIndex, cb) {
22134
- var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
22135
- var sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
22136
- var childMap = {},
22137
- zIdxArray = [];
22138
- var needSort = !1;
22139
- if (sort3d) needSort = !0;else {
22140
- var lastZIndex;
22141
- graphic.forEachChildren(function (item, i) {
22142
- var _item$attribute$zInde = item.attribute.zIndex,
22143
- zIndex = _item$attribute$zInde === void 0 ? defaultZIndex : _item$attribute$zInde;
22144
- if (0 === i) lastZIndex = zIndex;else if (lastZIndex !== zIndex) return needSort = !0, !0;
22145
- return !1;
22146
- }, reverse);
22147
- }
22148
- if (needSort) {
22149
- graphic.forEachChildren(function (item) {
22150
- var _item$attribute$zInde2 = item.attribute.zIndex,
22151
- zIndex = _item$attribute$zInde2 === void 0 ? defaultZIndex : _item$attribute$zInde2;
22152
- childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [item], zIdxArray.push(zIndex));
22153
- }, reverse), zIdxArray.sort(function (a, b) {
22154
- return reverse ? b - a : a - b;
22155
- });
22156
- var skip = !1;
22157
- for (var i = 0; i < zIdxArray.length && !skip; i++) {
22158
- var idx = zIdxArray[i],
22159
- children = childMap[idx];
22160
- sort3d && children.sort(function (a, b) {
22161
- var _a, _b;
22162
- return (reverse ? -1 : 1) * ((null !== (_a = b.attribute.z) && void 0 !== _a ? _a : 0) - (null !== (_b = a.attribute.z) && void 0 !== _b ? _b : 0));
22163
- });
22164
- for (var _i = 0; _i < children.length; _i++) if (cb(children[_i], _i)) {
22165
- skip = !0;
22166
- break;
22167
- }
21876
+ }, {
21877
+ key: "free",
21878
+ value: function free(b) {
21879
+ this.pools.push(b);
22168
21880
  }
22169
- } else graphic.forEachChildren(cb, reverse);
22170
- }
22171
- function foreachAsync(graphic, defaultZIndex, cb) {
22172
- var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
22173
- return __awaiter$2(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
22174
- return _regeneratorRuntime().wrap(function _callee$(_context) {
22175
- while (1) switch (_context.prev = _context.next) {
22176
- case 0:
22177
- _context.next = 2;
22178
- return graphic.forEachChildrenAsync(cb, reverse);
22179
- case 2:
22180
- case "end":
22181
- return _context.stop();
22182
- }
22183
- }, _callee);
22184
- }));
22185
- }
22186
- function findNextGraphic(graphic, id, defaultZIndex) {
22187
- var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
22188
- var childMap = {},
22189
- zIdxArray = [];
22190
- var needSort = !1;
22191
- graphic.forEachChildren(function (item, i) {
22192
- var _item$attribute$zInde3 = item.attribute.zIndex,
22193
- zIndex = _item$attribute$zInde3 === void 0 ? defaultZIndex : _item$attribute$zInde3;
22194
- if (0 === i) ;else if (undefined !== zIndex) return needSort = !0, !0;
22195
- return !1;
22196
- }, reverse);
22197
- var result = null,
22198
- next = !1;
22199
- if (needSort) {
22200
- graphic.forEachChildren(function (item) {
22201
- var _item$attribute$zInde4 = item.attribute.zIndex,
22202
- zIndex = _item$attribute$zInde4 === void 0 ? defaultZIndex : _item$attribute$zInde4;
22203
- childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [item], zIdxArray.push(zIndex));
22204
- }, reverse), zIdxArray.sort(function (a, b) {
22205
- return reverse ? b - a : a - b;
22206
- });
22207
- var skip = !1;
22208
- for (var i = 0; i < zIdxArray.length && !skip; i++) {
22209
- var idx = zIdxArray[i],
22210
- children = childMap[idx];
22211
- for (var _i2 = 0; _i2 < children.length; _i2++) {
22212
- if (next) {
22213
- skip = !0, result = children[_i2];
22214
- break;
22215
- }
22216
- children[_i2]._uid !== id || (next = !0);
22217
- }
21881
+ }, {
21882
+ key: "length",
21883
+ get: function get() {
21884
+ return this.pools.length;
22218
21885
  }
22219
- } else graphic.forEachChildren(function (item) {
22220
- return next ? (result = item, !0) : (item._uid === id && (next = !0), !1);
22221
- }, reverse);
22222
- return result;
22223
- }
21886
+ }, {
21887
+ key: "release",
21888
+ value: function release() {
21889
+ this.pools = [];
21890
+ }
21891
+ }]);
21892
+ return DefaultBoundsAllocate;
21893
+ }();
21894
+ var boundsAllocate = new DefaultBoundsAllocate();
22224
21895
 
22225
21896
  var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
22226
21897
  var d,
@@ -22282,7 +21953,7 @@
22282
21953
  var d = context.dpr % 1;
22283
21954
  (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
22284
21955
  var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
22285
- context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.clear(), this.backupDirtyBounds.clear()), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
21956
+ context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22286
21957
  var _a, _b;
22287
21958
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22288
21959
  }).forEach(function (group) {
@@ -22345,7 +22016,7 @@
22345
22016
  }, subLayers.set(group._uid, incrementalLayer));
22346
22017
  var incrementalContext = incrementalLayer.layer.getNativeHandler().getContext(),
22347
22018
  idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
22348
- idc.dirtyBounds.clear(), idc.backupDirtyBounds.clear(), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
22019
+ idc.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
22349
22020
  drawContribution: idc,
22350
22021
  clear: "transparent",
22351
22022
  layer: incrementalLayer.layer,
@@ -22420,7 +22091,7 @@
22420
22091
  }, {
22421
22092
  key: "clearScreen",
22422
22093
  value: function clearScreen(renderService, context, drawContext) {
22423
- var _a, _b;
22094
+ var _a;
22424
22095
  var clear = drawContext.clear;
22425
22096
  if (clear) {
22426
22097
  var canvas = context.getCanvas(),
@@ -22432,7 +22103,7 @@
22432
22103
  y = 0;
22433
22104
  context.clearRect(x, y, width, height);
22434
22105
  var stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
22435
- if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
22106
+ if (stage && stage.backgroundImg && stage.resources) {
22436
22107
  var res = stage.resources.get(clear);
22437
22108
  res && "success" === res.state && res.data && context.drawImage(res.data, x, y, width, height);
22438
22109
  } else context.fillStyle = createColor(context, clear, {
@@ -22742,10 +22413,15 @@
22742
22413
  _classCallCheck(this, DefaultIncrementalDrawContribution);
22743
22414
  _this = _super.call(this, contributions, drawItemInterceptorContributions), _this.contributions = contributions, _this.lineRender = lineRender, _this.areaRender = areaRender, _this.drawItemInterceptorContributions = drawItemInterceptorContributions, _this.rendering = !1, _this.currFrameStartAt = 0, _this.currentIdx = 0, _this.status = STATUS.NORMAL, _this.checkingForDrawPromise = null, _this.hooks = {
22744
22415
  completeDraw: new SyncHook([])
22745
- }, _this.defaultRenderMap.set(_this.lineRender.numberType, _this.lineRender), _this.defaultRenderMap.set(_this.areaRender.numberType, _this.areaRender);
22416
+ };
22746
22417
  return _this;
22747
22418
  }
22748
22419
  _createClass(DefaultIncrementalDrawContribution, [{
22420
+ key: "init",
22421
+ value: function init() {
22422
+ _get(_getPrototypeOf(DefaultIncrementalDrawContribution.prototype), "init", this).call(this), this.defaultRenderMap.set(this.lineRender.numberType, this.lineRender), this.defaultRenderMap.set(this.areaRender.numberType, this.areaRender);
22423
+ }
22424
+ }, {
22749
22425
  key: "draw",
22750
22426
  value: function draw(renderService, drawContext) {
22751
22427
  return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
@@ -23055,17 +22731,18 @@
23055
22731
  DefaultIncrementalDrawContribution = __decorate$18([injectable(), __param$A(0, multiInject(GraphicRender)), __param$A(1, inject(DefaultIncrementalCanvasLineRender)), __param$A(2, inject(DefaultIncrementalCanvasAreaRender)), __param$A(3, inject(ContributionProvider)), __param$A(3, named(DrawItemInterceptor)), __metadata$T("design:paramtypes", [Array, Object, Object, Object])], DefaultIncrementalDrawContribution);
23056
22732
 
23057
22733
  var renderModule = new ContainerModule(function (bind) {
23058
- bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope(), bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope(), bind(DrawContribution).to(DefaultDrawContribution), bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution), bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope(), bind(GraphicRender).toService(GroupRender), bindContributionProvider(bind, GroupRenderContribution), bind(exports.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(), bindContributionProvider(bind, InteractiveSubRenderContribution), bindContributionProvider(bind, GraphicRender), bind(exports.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(), bind(DrawItemInterceptor).toService(exports.CommonDrawItemInterceptorContribution), bindContributionProvider(bind, DrawItemInterceptor);
22734
+ bind(DefaultBaseBackgroundRenderContribution).toSelf().inSingletonScope(), bind(DefaultBaseTextureRenderContribution).toSelf().inSingletonScope(), bind(DrawContribution).to(DefaultDrawContribution), bind(IncrementalDrawContribution).to(DefaultIncrementalDrawContribution), bind(GroupRender).to(DefaultCanvasGroupRender).inSingletonScope(), bind(GraphicRender).toService(GroupRender), bindContributionProvider(bind, GroupRenderContribution), bind(exports.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(), bindContributionProvider(bind, InteractiveSubRenderContribution), bindContributionProvider(bind, GraphicRender), bind(CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(), bind(DrawItemInterceptor).toService(CommonDrawItemInterceptorContribution), bindContributionProvider(bind, DrawItemInterceptor);
23059
22735
  });
23060
22736
 
23061
22737
  function load(container) {
23062
22738
  container.load(renderModule);
23063
22739
  }
23064
22740
 
22741
+ var loaded$r = !1;
23065
22742
  function preLoadAllModule() {
23066
- preLoadAllModule.__loaded || (preLoadAllModule.__loaded = !0, container.load(coreModule), container.load(graphicModule), container.load(renderModule$1), container.load(pickModule), container.load(pluginModule), load$1(container), load(container));
22743
+ loaded$r || (loaded$r = !0, container.load(coreModule), container.load(graphicModule), container.load(renderModule$1), container.load(pickModule), container.load(pluginModule), load$1(container), load(container));
23067
22744
  }
23068
- preLoadAllModule.__loaded = !1, preLoadAllModule();
22745
+ preLoadAllModule();
23069
22746
  var vglobal = container.get(VGlobal);
23070
22747
  application.global = vglobal;
23071
22748
  var graphicUtil = container.get(GraphicUtil);
@@ -23276,7 +22953,7 @@
23276
22953
  graphic.bindDom.forEach(function (_ref) {
23277
22954
  var wrapGroup = _ref.wrapGroup;
23278
22955
  application.global.removeDom(wrapGroup);
23279
- }), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
22956
+ }), nativeDom = "string" == typeof dom ? new DOMParser().parseFromString(dom, "text/html").firstChild : dom;
23280
22957
  var _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
23281
22958
  nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer();
23282
22959
  var wrapGroup = application.global.createDom({
@@ -23293,11 +22970,13 @@
23293
22970
  })), wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
23294
22971
  var left = 0,
23295
22972
  top = 0;
23296
- var b = graphic.globalAABBBounds;
23297
- if ("position" === anchorType || b.empty()) {
23298
- var matrix = graphic.globalTransMatrix;
22973
+ if ("position" === anchorType) {
22974
+ var matrix = graphic.transMatrix;
23299
22975
  left = matrix.e, top = matrix.f;
23300
- } else left = b.x1, top = b.y1;
22976
+ } else {
22977
+ var b = graphic.AABBBounds;
22978
+ left = b.x1, top = b.y1;
22979
+ }
23301
22980
  var containerTL = application.global.getElementTopLeft(nativeContainer, !1),
23302
22981
  windowTL = stage.window.getTopLeft(!1),
23303
22982
  offsetX = left + windowTL.left - containerTL.left,
@@ -23722,21 +23401,24 @@
23722
23401
 
23723
23402
  var _isBrowserEnv;
23724
23403
  function initIsBrowserEnv() {
23725
- if (null == _isBrowserEnv) try {
23726
- _isBrowserEnv = globalThis === window, _isBrowserEnv && (_isBrowserEnv = !!document.createElement);
23727
- } catch (err) {
23728
- _isBrowserEnv = !1;
23404
+ if (null == _isBrowserEnv) {
23405
+ try {
23406
+ _isBrowserEnv = !!window;
23407
+ } catch (err) {
23408
+ _isBrowserEnv = !1;
23409
+ }
23410
+ if (_isBrowserEnv) try {
23411
+ _isBrowserEnv = !tt;
23412
+ } catch (err) {
23413
+ _isBrowserEnv = !0;
23414
+ }
23729
23415
  }
23730
23416
  }
23731
23417
  function isBrowserEnv() {
23732
- initIsBrowserEnv();
23733
- var env = application.global && application.global.env;
23734
- return env ? "browser" === env : _isBrowserEnv;
23418
+ return initIsBrowserEnv(), _isBrowserEnv;
23735
23419
  }
23736
23420
  function isNodeEnv() {
23737
- initIsBrowserEnv();
23738
- var env = application.global && application.global.env;
23739
- return env ? "node" === env : !_isBrowserEnv;
23421
+ return initIsBrowserEnv(), !_isBrowserEnv;
23740
23422
  }
23741
23423
  function getCurrentEnv() {
23742
23424
  return isBrowserEnv() ? "browser" : "node";
@@ -23874,8 +23556,6 @@
23874
23556
  resolution: this.window.dpr || this.global.devicePixelRatio,
23875
23557
  rootNode: this,
23876
23558
  global: this.global,
23877
- supportsPointerEvents: this.params.supportsPointerEvents,
23878
- supportsTouchEvents: this.params.supportsTouchEvents,
23879
23559
  viewport: {
23880
23560
  viewBox: this._viewBox,
23881
23561
  get x() {
@@ -24120,7 +23800,7 @@
24120
23800
  }, {
24121
23801
  key: "tryInitInteractiveLayer",
24122
23802
  value: function tryInitInteractiveLayer() {
24123
- this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
23803
+ this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.nextFrameRenderLayerSet.add(this.interactiveLayer));
24124
23804
  }
24125
23805
  }, {
24126
23806
  key: "clearViewBox",
@@ -27005,7 +26685,7 @@
27005
26685
  ops: I(t, e, s, n, a)
27006
26686
  };
27007
26687
  }
27008
- function m$2(t, e, s) {
26688
+ function m(t, e, s) {
27009
26689
  var n = (t || []).length;
27010
26690
  if (n > 2) {
27011
26691
  var _a5 = [];
@@ -27022,7 +26702,7 @@
27022
26702
  }
27023
26703
  function w(t, e, s, n, a) {
27024
26704
  return function (t, e) {
27025
- return m$2(t, !0, e);
26705
+ return m(t, !0, e);
27026
26706
  }([[t, e], [t + s, e], [t + s, e + n], [t, e + n]], a);
27027
26707
  }
27028
26708
  function x(t, e) {
@@ -27458,7 +27138,7 @@
27458
27138
  key: "linearPath",
27459
27139
  value: function linearPath(t, e) {
27460
27140
  var s = this._o(e);
27461
- return this._d("linearPath", [m$2(t, !1, s)], s);
27141
+ return this._d("linearPath", [m(t, !1, s)], s);
27462
27142
  }
27463
27143
  }, {
27464
27144
  key: "arc",
@@ -27525,7 +27205,7 @@
27525
27205
  value: function polygon(t, e) {
27526
27206
  var s = this._o(e),
27527
27207
  n = [],
27528
- a = m$2(t, !0, s);
27208
+ a = m(t, !0, s);
27529
27209
  return s.fill && ("solid" === s.fillStyle ? n.push(S([t], s)) : n.push(L([t], s))), s.stroke !== H && n.push(a), this._d("polygon", n, s);
27530
27210
  }
27531
27211
  }, {
@@ -27591,7 +27271,7 @@
27591
27271
  return l;
27592
27272
  }(t, 1, h ? 4 - 4 * s.simplification : (1 + s.roughness) / 2);
27593
27273
  return a && ("solid" === s.fillStyle ? n.push(S(r, s)) : n.push(L(r, s))), o && (h ? r.forEach(function (t) {
27594
- n.push(m$2(t, !1, s));
27274
+ n.push(m(t, !1, s));
27595
27275
  }) : n.push(function (t, e) {
27596
27276
  var s = g(d(f(t))),
27597
27277
  n = [];
@@ -30239,11 +29919,10 @@
30239
29919
  }();
30240
29920
  DefaultCanvasGroupPicker = __decorate$O([injectable()], DefaultCanvasGroupPicker);
30241
29921
 
30242
- var m$1 = new ContainerModule(function (bind, unbind, isBound, rebind) {
30243
- m$1.__vloaded || (m$1.__vloaded = !0, bind(CanvasGroupPicker).to(DefaultCanvasGroupPicker).inSingletonScope(), bind(CanvasPickerContribution).toService(CanvasGroupPicker), bindContributionProvider(bind, CanvasPickerContribution));
29922
+ var loaded$q = !1;
29923
+ var canvasModule = new ContainerModule(function (bind, unbind, isBound, rebind) {
29924
+ loaded$q || (loaded$q = !0, bind(CanvasGroupPicker).to(DefaultCanvasGroupPicker).inSingletonScope(), bind(CanvasPickerContribution).toService(CanvasGroupPicker), bindContributionProvider(bind, CanvasPickerContribution));
30244
29925
  });
30245
- m$1.__vloaded = !1;
30246
- var canvasModule = m$1;
30247
29926
 
30248
29927
  var canvasPickerModule = new ContainerModule(function (bind, unbind, isBound, rebind) {
30249
29928
  isBound(DefaultCanvasPickerService) || bind(DefaultCanvasPickerService).toSelf().inSingletonScope(), isBound(PickerService) ? rebind(PickerService).toService(DefaultCanvasPickerService) : bind(PickerService).toService(DefaultCanvasPickerService);
@@ -30590,7 +30269,7 @@
30590
30269
  key: "getNativeAABBBounds",
30591
30270
  value: function getNativeAABBBounds(_dom) {
30592
30271
  var dom = _dom;
30593
- if ("string" == typeof _dom && (dom = new DOMParser().parseFromString(_dom, "text/html").firstChild, dom.lastChild && (dom = dom.lastChild.firstChild)), dom.getBoundingClientRect) {
30272
+ if ("string" == typeof _dom && (dom = new DOMParser().parseFromString(_dom, "text/html").firstChild), dom.getBoundingClientRect) {
30594
30273
  var b = dom.getBoundingClientRect();
30595
30274
  return new DynamicB(b);
30596
30275
  }
@@ -30752,15 +30431,15 @@
30752
30431
  }(exports.BaseEnvContribution);
30753
30432
  BrowserEnvContribution = __decorate$M([injectable(), __metadata$D("design:paramtypes", [])], BrowserEnvContribution);
30754
30433
 
30434
+ var isBrowserBound = !1;
30755
30435
  var browserEnvModule = new ContainerModule(function (bind) {
30756
- browserEnvModule.isBrowserBound || (browserEnvModule.isBrowserBound = !0, bind(BrowserEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(BrowserEnvContribution));
30436
+ isBrowserBound || (isBrowserBound = !0, bind(BrowserEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(BrowserEnvContribution));
30757
30437
  });
30758
- browserEnvModule.isBrowserBound = !1;
30438
+ var loaded$p = !1;
30759
30439
  function loadBrowserEnv(container) {
30760
30440
  var loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
30761
- loadBrowserEnv.__loaded || (loadBrowserEnv.__loaded = !0, container.load(browserEnvModule), container.load(browserCanvasModule), container.load(browserWindowModule), loadPicker && loadCanvasPicker(container));
30441
+ loaded$p || (loaded$p = !0, container.load(browserEnvModule), container.load(browserCanvasModule), container.load(browserWindowModule), loadPicker && loadCanvasPicker(container));
30762
30442
  }
30763
- loadBrowserEnv.__loaded = !1;
30764
30443
  function initBrowserEnv() {
30765
30444
  loadBrowserEnv(container);
30766
30445
  }
@@ -31125,11 +30804,10 @@
31125
30804
  }(exports.DefaultPickService);
31126
30805
  DefaultMathPickerService = __decorate$I([injectable(), __param$r(0, inject(ContributionProvider)), __param$r(0, named(MathPickerContribution)), __param$r(1, inject(ContributionProvider)), __param$r(1, named(PickItemInterceptor)), __metadata$A("design:paramtypes", [Object, Object])], DefaultMathPickerService);
31127
30806
 
31128
- var m = new ContainerModule(function (bind) {
31129
- m.__vloaded || (m.__vloaded = !0, bindContributionProvider(bind, MathPickerContribution));
30807
+ var loaded$o = !1;
30808
+ var mathModule = new ContainerModule(function (bind) {
30809
+ loaded$o || (loaded$o = !0, bindContributionProvider(bind, MathPickerContribution));
31130
30810
  });
31131
- m.__vloaded = !1;
31132
- var mathModule = m;
31133
30811
 
31134
30812
  var mathPickerModule = new ContainerModule(function (bind, unbind, isBound, rebind) {
31135
30813
  isBound(DefaultMathPickerService) || bind(DefaultMathPickerService).toSelf().inSingletonScope(), isBound(PickerService) ? rebind(PickerService).toService(DefaultMathPickerService) : bind(PickerService).toService(DefaultMathPickerService);
@@ -31138,105 +30816,6 @@
31138
30816
  c.load(mathModule), c.load(mathPickerModule);
31139
30817
  }
31140
30818
 
31141
- var CanvasWrapDisableWH = /*#__PURE__*/function () {
31142
- function CanvasWrapDisableWH(nativeCanvas, ctx, dpr, w, h, id) {
31143
- _classCallCheck(this, CanvasWrapDisableWH);
31144
- this.nativeCanvas = nativeCanvas, this.ctx = ctx, this._w = w, this._h = h, this.id = id, nativeCanvas.id = id, this.dpr = dpr;
31145
- }
31146
- _createClass(CanvasWrapDisableWH, [{
31147
- key: "width",
31148
- get: function get() {
31149
- return this._w * this.dpr;
31150
- },
31151
- set: function set(w) {}
31152
- }, {
31153
- key: "height",
31154
- get: function get() {
31155
- return this._h * this.dpr;
31156
- },
31157
- set: function set(h) {}
31158
- }, {
31159
- key: "offsetWidth",
31160
- get: function get() {
31161
- return this._w;
31162
- },
31163
- set: function set(w) {}
31164
- }, {
31165
- key: "offsetHeight",
31166
- get: function get() {
31167
- return this._h;
31168
- },
31169
- set: function set(h) {}
31170
- }, {
31171
- key: "getContext",
31172
- value: function getContext() {
31173
- return this.ctx;
31174
- }
31175
- }, {
31176
- key: "getBoundingClientRect",
31177
- value: function getBoundingClientRect() {
31178
- return {
31179
- width: this._w,
31180
- height: this._h
31181
- };
31182
- }
31183
- }]);
31184
- return CanvasWrapDisableWH;
31185
- }();
31186
- var CanvasWrapEnableWH = /*#__PURE__*/function () {
31187
- function CanvasWrapEnableWH(nativeCanvas, ctx, dpr, w, h, id) {
31188
- _classCallCheck(this, CanvasWrapEnableWH);
31189
- this.nativeCanvas = nativeCanvas, this.ctx = ctx, this._w = w, this._h = h, this.id = id, nativeCanvas.id = id, this.dpr = dpr;
31190
- }
31191
- _createClass(CanvasWrapEnableWH, [{
31192
- key: "width",
31193
- get: function get() {
31194
- return this._w * this.dpr;
31195
- },
31196
- set: function set(w) {
31197
- this._w = w / this.dpr, this.nativeCanvas.width = w;
31198
- }
31199
- }, {
31200
- key: "height",
31201
- get: function get() {
31202
- return this._h * this.dpr;
31203
- },
31204
- set: function set(h) {
31205
- this._h = h / this.dpr, this.nativeCanvas.height = h;
31206
- }
31207
- }, {
31208
- key: "offsetWidth",
31209
- get: function get() {
31210
- return this._w;
31211
- },
31212
- set: function set(w) {
31213
- this._w = w, this.nativeCanvas.width = w * this.dpr;
31214
- }
31215
- }, {
31216
- key: "offsetHeight",
31217
- get: function get() {
31218
- return this._h;
31219
- },
31220
- set: function set(h) {
31221
- this._h = h, this.nativeCanvas.height = h * this.dpr;
31222
- }
31223
- }, {
31224
- key: "getContext",
31225
- value: function getContext() {
31226
- return this.ctx;
31227
- }
31228
- }, {
31229
- key: "getBoundingClientRect",
31230
- value: function getBoundingClientRect() {
31231
- return {
31232
- width: this._w,
31233
- height: this._h
31234
- };
31235
- }
31236
- }]);
31237
- return CanvasWrapEnableWH;
31238
- }();
31239
-
31240
30819
  var __decorate$H = undefined && undefined.__decorate || function (decorators, target, key, desc) {
31241
30820
  var d,
31242
30821
  c = arguments.length,
@@ -31247,12 +30826,31 @@
31247
30826
  __metadata$z = undefined && undefined.__metadata || function (k, v) {
31248
30827
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
31249
30828
  };
31250
- function makeUpCanvas$3(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, pixelRatio) {
31251
- var dpr = null != pixelRatio ? pixelRatio : tt.getSystemInfoSync().pixelRatio;
30829
+ function makeUpCanvas$3(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
30830
+ var dpr = tt.getSystemInfoSync().pixelRatio;
31252
30831
  canvasIdLists.forEach(function (id, i) {
31253
- var ctx = tt.createCanvasContext(id),
31254
- canvas = new CanvasWrapDisableWH(ctx.canvas || {}, ctx, dpr, domref.width, domref.height, id);
31255
- ctx.canvas = canvas, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
30832
+ var ctx = tt.createCanvasContext(id);
30833
+ ctx.canvas = {
30834
+ width: domref.width * dpr,
30835
+ height: domref.height * dpr
30836
+ };
30837
+ var canvas = {
30838
+ width: domref.width * dpr,
30839
+ height: domref.height * dpr,
30840
+ offsetWidth: domref.width,
30841
+ offsetHeight: domref.height,
30842
+ id: null != id ? id : "",
30843
+ getContext: function getContext() {
30844
+ return ctx;
30845
+ },
30846
+ getBoundingClientRect: function getBoundingClientRect() {
30847
+ return {
30848
+ height: domref.height,
30849
+ width: domref.width
30850
+ };
30851
+ }
30852
+ };
30853
+ canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
31256
30854
  });
31257
30855
  }
31258
30856
  var FeishuEnvContribution = /*#__PURE__*/function (_BaseEnvContribution) {
@@ -31283,7 +30881,7 @@
31283
30881
  }, {
31284
30882
  key: "configure",
31285
30883
  value: function configure(service, params) {
31286
- service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$3(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList, params.pixelRatio));
30884
+ service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$3(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList));
31287
30885
  }
31288
30886
  }, {
31289
30887
  key: "loadImage",
@@ -31373,15 +30971,15 @@
31373
30971
  }(exports.BaseEnvContribution);
31374
30972
  FeishuEnvContribution = __decorate$H([injectable(), __metadata$z("design:paramtypes", [])], FeishuEnvContribution);
31375
30973
 
30974
+ var isFeishuBound = !1;
31376
30975
  var feishuEnvModule = new ContainerModule(function (bind) {
31377
- feishuEnvModule.isFeishuBound || (feishuEnvModule.isFeishuBound = !0, bind(FeishuEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(FeishuEnvContribution));
30976
+ isFeishuBound || (isFeishuBound = !0, bind(FeishuEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(FeishuEnvContribution));
31378
30977
  });
31379
- feishuEnvModule.isFeishuBound = !1;
30978
+ var loaded$n = !1;
31380
30979
  function loadFeishuEnv(container) {
31381
30980
  var loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
31382
- loadFeishuEnv.__loaded || (loadFeishuEnv.__loaded = !0, container.load(feishuEnvModule), container.load(feishuCanvasModule), container.load(feishuWindowModule), loadPicker && loadMathPicker(container));
30981
+ loaded$n || (loaded$n = !0, container.load(feishuEnvModule), container.load(feishuCanvasModule), container.load(feishuWindowModule), loadPicker && loadMathPicker(container));
31383
30982
  }
31384
- loadFeishuEnv.__loaded = !1;
31385
30983
  function initFeishuEnv() {
31386
30984
  loadFeishuEnv(container);
31387
30985
  }
@@ -31461,11 +31059,11 @@
31461
31059
  value: function draw() {
31462
31060
  var _this = this;
31463
31061
  var _context = this.nativeContext;
31464
- _context.draw && (this.drawPromise = new Promise(function (resolve) {
31062
+ this.drawPromise = new Promise(function (resolve) {
31465
31063
  _context.draw(!0, function () {
31466
31064
  _this.drawPromise = null, resolve(null);
31467
31065
  });
31468
- }));
31066
+ });
31469
31067
  }
31470
31068
  }]);
31471
31069
  return LynxContext2d;
@@ -31734,13 +31332,32 @@
31734
31332
  try {
31735
31333
  ng = !!lynx.createCanvasNG;
31736
31334
  } catch (err) {}
31737
- function makeUpCanvas$2(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, pixelRatio) {
31738
- var dpr = null != pixelRatio ? pixelRatio : SystemInfo.pixelRatio;
31335
+ function makeUpCanvas$2(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
31336
+ var dpr = SystemInfo.pixelRatio;
31739
31337
  canvasIdLists.forEach(function (id, i) {
31740
31338
  var _canvas = ng ? lynx.createCanvasNG(id) : lynx.createCanvas(id);
31741
31339
  _canvas.width = domref.width * dpr, _canvas.height = domref.height * dpr, ng && _canvas.attachToCanvasView(id);
31742
- var ctx = _canvas.getContext("2d"),
31743
- canvas = new CanvasWrapEnableWH(_canvas, ctx, dpr, domref.width, domref.height, id);
31340
+ var ctx = _canvas.getContext("2d");
31341
+ ctx.draw = function (a, b) {
31342
+ b();
31343
+ };
31344
+ var canvas = {
31345
+ width: domref.width * dpr,
31346
+ height: domref.height * dpr,
31347
+ offsetWidth: domref.width,
31348
+ offsetHeight: domref.height,
31349
+ id: null != id ? id : "",
31350
+ getContext: function getContext() {
31351
+ return ctx;
31352
+ },
31353
+ getBoundingClientRect: function getBoundingClientRect() {
31354
+ return {
31355
+ height: domref.height,
31356
+ width: domref.width
31357
+ };
31358
+ },
31359
+ nativeCanvas: _canvas
31360
+ };
31744
31361
  canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
31745
31362
  });
31746
31363
  }
@@ -31774,7 +31391,7 @@
31774
31391
  _createClass(LynxEnvContribution, [{
31775
31392
  key: "configure",
31776
31393
  value: function configure(service, params) {
31777
- service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$2(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList, params.pixelRatio));
31394
+ service.env === this.type && (service.setActiveEnvContribution(this), makeUpCanvas$2(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList));
31778
31395
  }
31779
31396
  }, {
31780
31397
  key: "getDynamicCanvasCount",
@@ -31881,15 +31498,15 @@
31881
31498
  }(exports.BaseEnvContribution);
31882
31499
  LynxEnvContribution = __decorate$D([injectable(), __metadata$w("design:paramtypes", [])], LynxEnvContribution);
31883
31500
 
31501
+ var isLynxBound = !1;
31884
31502
  var lynxEnvModule = new ContainerModule(function (bind) {
31885
- lynxEnvModule.isLynxBound || (lynxEnvModule.isLynxBound = !0, bind(LynxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(LynxEnvContribution));
31503
+ isLynxBound || (isLynxBound = !0, bind(LynxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(LynxEnvContribution));
31886
31504
  });
31887
- lynxEnvModule.isLynxBound = !1;
31505
+ var loaded$m = !1;
31888
31506
  function loadLynxEnv(container) {
31889
31507
  var loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
31890
- loadLynxEnv.__loaded || (loadLynxEnv.__loaded = !0, container.load(lynxEnvModule), container.load(lynxCanvasModule), container.load(lynxWindowModule), loadPicker && loadMathPicker(container));
31508
+ loaded$m || (loaded$m = !0, container.load(lynxEnvModule), container.load(lynxCanvasModule), container.load(lynxWindowModule), loadPicker && loadMathPicker(container));
31891
31509
  }
31892
- loadLynxEnv.__loaded = !1;
31893
31510
  function initLynxEnv() {
31894
31511
  loadLynxEnv(container);
31895
31512
  }
@@ -32262,14 +31879,14 @@
32262
31879
  }(exports.BaseEnvContribution);
32263
31880
  NodeEnvContribution = __decorate$z([injectable()], NodeEnvContribution);
32264
31881
 
31882
+ var isNodeBound = !1;
32265
31883
  var nodeEnvModule = new ContainerModule(function (bind) {
32266
- nodeEnvModule.isNodeBound || (nodeEnvModule.isNodeBound = !0, bind(NodeEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(NodeEnvContribution));
31884
+ isNodeBound || (isNodeBound = !0, bind(NodeEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(NodeEnvContribution));
32267
31885
  });
32268
- nodeEnvModule.isNodeBound = !1;
31886
+ var loaded$l = !1;
32269
31887
  function loadNodeEnv(container) {
32270
- loadNodeEnv.__loaded || (loadNodeEnv.__loaded = !0, container.load(nodeEnvModule), container.load(nodeCanvasModule), container.load(nodeWindowModule));
31888
+ loaded$l || (loaded$l = !0, container.load(nodeEnvModule), container.load(nodeCanvasModule), container.load(nodeWindowModule));
32271
31889
  }
32272
- loadNodeEnv.__loaded = !1;
32273
31890
  function initNodeEnv() {
32274
31891
  loadNodeEnv(container);
32275
31892
  }
@@ -32366,34 +31983,6 @@
32366
31983
  value: function createPattern(image, repetition) {
32367
31984
  return null;
32368
31985
  }
32369
- }, {
32370
- key: "getImageData",
32371
- value: function getImageData(sx, sy, sw, sh) {
32372
- var _this = this;
32373
- var ctx = this.nativeContext,
32374
- taro = ctx.taro;
32375
- if (ctx && taro) return !ctx.getImageData && taro.canvasGetImageData ? new Promise(function (resolve, reject) {
32376
- try {
32377
- taro.canvasGetImageData({
32378
- canvasId: _this.canvas.nativeCanvas.id,
32379
- sx: sx,
32380
- sy: sy,
32381
- sw: sw,
32382
- sh: sh,
32383
- success: function success(res) {
32384
- resolve(res);
32385
- }
32386
- });
32387
- } catch (err) {
32388
- reject(err);
32389
- }
32390
- }) : void 0;
32391
- }
32392
- }, {
32393
- key: "createRadialGradient",
32394
- value: function createRadialGradient(x0, y0, r0, x1, y1, r1) {
32395
- return this.nativeContext.createCircularGradient && this.nativeContext.createCircularGradient(x0, y0, r0, x1, y1, r1);
32396
- }
32397
31986
  }]);
32398
31987
  return TaroContext2d;
32399
31988
  }(BrowserContext2d);
@@ -32661,9 +32250,47 @@
32661
32250
  };
32662
32251
  function makeUpCanvas$1(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, taro, dpr) {
32663
32252
  canvasIdLists.forEach(function (id, i) {
32664
- var ctx = taro.createCanvasContext(id),
32665
- canvas = new CanvasWrapDisableWH(ctx.canvas || {}, ctx, dpr, domref.width, domref.height, id);
32666
- return ctx.canvas = canvas, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas), canvas;
32253
+ var ctx = taro.createCanvasContext(id);
32254
+ ctx.canvas = {
32255
+ width: domref.width * dpr,
32256
+ height: domref.height * dpr
32257
+ }, ctx.createRadialGradient || (ctx.createRadialGradient = function () {
32258
+ return ctx.createCircularGradient.apply(ctx, arguments);
32259
+ }), !ctx.getImageData && taro.canvasGetImageData && (ctx.getImageData = function (x, y, width, height) {
32260
+ return new Promise(function (resolve, reject) {
32261
+ try {
32262
+ taro.canvasGetImageData({
32263
+ canvasId: id,
32264
+ x: x,
32265
+ y: y,
32266
+ width: width,
32267
+ height: height,
32268
+ success: function success(res) {
32269
+ resolve(res);
32270
+ }
32271
+ });
32272
+ } catch (err) {
32273
+ reject(err);
32274
+ }
32275
+ });
32276
+ });
32277
+ var canvas = {
32278
+ id: id,
32279
+ width: domref.width * dpr,
32280
+ height: domref.height * dpr,
32281
+ offsetWidth: domref.width,
32282
+ offsetHeight: domref.height,
32283
+ getContext: function getContext() {
32284
+ return ctx;
32285
+ },
32286
+ getBoundingClientRect: function getBoundingClientRect() {
32287
+ return {
32288
+ height: domref.height,
32289
+ width: domref.width
32290
+ };
32291
+ }
32292
+ };
32293
+ return canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas), canvas;
32667
32294
  });
32668
32295
  }
32669
32296
  var TaroEnvContribution = /*#__PURE__*/function (_BaseEnvContribution) {
@@ -32800,15 +32427,15 @@
32800
32427
  }(exports.BaseEnvContribution);
32801
32428
  TaroEnvContribution = __decorate$v([injectable(), __metadata$q("design:paramtypes", [])], TaroEnvContribution);
32802
32429
 
32430
+ var isTaroBound = !1;
32803
32431
  var taroEnvModule = new ContainerModule(function (bind) {
32804
- taroEnvModule.isTaroBound || (taroEnvModule.isTaroBound = !0, bind(TaroEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(TaroEnvContribution));
32432
+ isTaroBound || (isTaroBound = !0, bind(TaroEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(TaroEnvContribution));
32805
32433
  });
32806
- taroEnvModule.isTaroBound = !1;
32434
+ var loaded$k = !1;
32807
32435
  function loadTaroEnv(container) {
32808
32436
  var loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
32809
- loadTaroEnv.__loaded || (loadTaroEnv.__loaded = !0, container.load(taroEnvModule), container.load(taroCanvasModule), container.load(taroWindowModule), loadPicker && loadMathPicker(container));
32437
+ loaded$k || (loaded$k = !0, container.load(taroEnvModule), container.load(taroCanvasModule), container.load(taroWindowModule), loadPicker && loadMathPicker(container));
32810
32438
  }
32811
- loadTaroEnv.__loaded = !1;
32812
32439
  function initTaroEnv() {
32813
32440
  loadTaroEnv(container);
32814
32441
  }
@@ -33275,15 +32902,15 @@
33275
32902
  }(exports.BaseEnvContribution);
33276
32903
  WxEnvContribution = __decorate$r([injectable(), __metadata$n("design:paramtypes", [])], WxEnvContribution);
33277
32904
 
32905
+ var isWxBound = !1;
33278
32906
  var wxEnvModule = new ContainerModule(function (bind) {
33279
- wxEnvModule._isWxBound || (wxEnvModule._isWxBound = !0, bind(WxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(WxEnvContribution));
32907
+ isWxBound || (isWxBound = !0, bind(WxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(WxEnvContribution));
33280
32908
  });
33281
- wxEnvModule._isWxBound = !1;
32909
+ var loaded$j = !1;
33282
32910
  function loadWxEnv(container) {
33283
32911
  var loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
33284
- loadWxEnv.__loaded || (loadWxEnv.__loaded = !0, container.load(wxEnvModule), container.load(wxCanvasModule), container.load(wxWindowModule), loadPicker && loadMathPicker(container));
32912
+ loaded$j || (loaded$j = !0, container.load(wxEnvModule), container.load(wxCanvasModule), container.load(wxWindowModule), loadPicker && loadMathPicker(container));
33285
32913
  }
33286
- loadWxEnv.__loaded = !1;
33287
32914
  function initWxEnv() {
33288
32915
  loadWxEnv(container);
33289
32916
  }
@@ -33291,12 +32918,12 @@
33291
32918
  function loadAllEnv(container) {
33292
32919
  loadAllModule(container);
33293
32920
  }
32921
+ var loaded$i = !1;
33294
32922
  function loadAllModule(container) {
33295
- loadAllModule.__loaded || (loadAllModule.__loaded = !0, loadBrowserEnv(container, !1), loadFeishuEnv(container, !1), loadLynxEnv(container, !1), loadNodeEnv(container), loadTaroEnv(container, !1), loadWxEnv(container, !1), loadCanvasPicker(container), vglobal.hooks.onSetEnv.tap("loadMathPicker", function (lastEnv, env) {
32923
+ loaded$i || (loaded$i = !0, loadBrowserEnv(container, !1), loadFeishuEnv(container, !1), loadLynxEnv(container, !1), loadNodeEnv(container), loadTaroEnv(container, !1), loadWxEnv(container, !1), loadCanvasPicker(container), vglobal.hooks.onSetEnv.tap("loadMathPicker", function (lastEnv, env) {
33296
32924
  "browser" !== env && loadMathPicker(container);
33297
32925
  }));
33298
32926
  }
33299
- loadAllModule.__loaded = !1;
33300
32927
  function initAllEnv() {
33301
32928
  loadAllEnv(container);
33302
32929
  }
@@ -33751,24 +33378,13 @@
33751
33378
  x = _area$attribute$x === void 0 ? areaAttribute.x : _area$attribute$x,
33752
33379
  _area$attribute$y = _area$attribute.y,
33753
33380
  y = _area$attribute$y === void 0 ? areaAttribute.y : _area$attribute$y;
33754
- var _area$attribute2 = area.attribute,
33755
- _area$attribute2$fill = _area$attribute2.fillPickable,
33756
- fillPickable = _area$attribute2$fill === void 0 ? areaAttribute.fillPickable : _area$attribute2$fill,
33757
- _area$attribute2$stro = _area$attribute2.strokePickable,
33758
- strokePickable = _area$attribute2$stro === void 0 ? areaAttribute.strokePickable : _area$attribute2$stro;
33759
33381
  if (pickContext.highPerformanceSave(), area.transMatrix.onlyTranslate()) {
33760
33382
  var _point = area.getOffsetXY(areaAttribute);
33761
33383
  x += _point.x, y += _point.y, pickContext.setTransformForCurrent();
33762
33384
  } else x = 0, y = 0, pickContext.transformFromMatrix(area.transMatrix, !0);
33763
33385
  var picked = !1;
33764
33386
  return this.canvasRenderer.drawShape(area, pickContext, x, y, {}, null, function (context) {
33765
- return !!picked || !!fillPickable && (picked = context.isPointInPath(point.x, point.y), picked);
33766
- }, function (context, areaAttribute, themeAttribute) {
33767
- if (picked) return !0;
33768
- if (!strokePickable) return !1;
33769
- var lineWidth = areaAttribute.lineWidth || themeAttribute.lineWidth,
33770
- pickStrokeBuffer = areaAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
33771
- return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
33387
+ return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
33772
33388
  }), pickContext.highPerformanceRestore(), picked;
33773
33389
  }
33774
33390
  }]);
@@ -34798,117 +34414,99 @@
34798
34414
 
34799
34415
  var browser = isBrowserEnv();
34800
34416
 
34801
- function _registerArc() {
34802
- _registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser ? arcCanvasPickModule : arcMathPickModule));
34417
+ var loaded$h = !1;
34418
+ function registerArc() {
34419
+ loaded$h || (loaded$h = !0, registerArcGraphic(), container.load(arcModule), container.load(browser ? arcCanvasPickModule : arcMathPickModule));
34803
34420
  }
34804
- _registerArc.__loaded = !1;
34805
- var registerArc = _registerArc;
34806
34421
 
34807
- function _registerArc3d() {
34808
- _registerArc3d.__loaded || (_registerArc3d.__loaded = !0, registerArc3dGraphic(), container.load(arc3dModule), container.load(arc3dCanvasPickModule));
34422
+ var loaded$g = !1;
34423
+ function registerArc3d() {
34424
+ loaded$g || (loaded$g = !0, registerArc3dGraphic(), container.load(arc3dModule), container.load(arc3dCanvasPickModule));
34809
34425
  }
34810
- _registerArc3d.__loaded = !1;
34811
- var registerArc3d = _registerArc3d;
34812
34426
 
34813
- function _registerArea() {
34814
- _registerArea.__loaded || (_registerArea.__loaded = !0, registerAreaGraphic(), container.load(areaModule), container.load(browser ? areaCanvasPickModule : areaMathPickModule));
34427
+ var loaded$f = !1;
34428
+ function registerArea() {
34429
+ loaded$f || (loaded$f = !0, registerAreaGraphic(), container.load(areaModule), container.load(browser ? areaCanvasPickModule : areaMathPickModule));
34815
34430
  }
34816
- _registerArea.__loaded = !1;
34817
- var registerArea = _registerArea;
34818
34431
 
34819
- function _registerCircle() {
34820
- _registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser ? circleCanvasPickModule : circleMathPickModule));
34432
+ var loaded$e = !1;
34433
+ function registerCircle() {
34434
+ loaded$e || (loaded$e = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser ? circleCanvasPickModule : circleMathPickModule));
34821
34435
  }
34822
- _registerCircle.__loaded = !1;
34823
- var registerCircle = _registerCircle;
34824
34436
 
34825
- function _registerGlyph() {
34826
- _registerGlyph.__loaded || (_registerGlyph.__loaded = !0, registerGlyphGraphic(), container.load(glyphModule), container.load(browser ? glyphCanvasPickModule : glyphMathPickModule));
34437
+ var loaded$d = !1;
34438
+ function registerGlyph() {
34439
+ loaded$d || (loaded$d = !0, registerGlyphGraphic(), container.load(glyphModule), container.load(browser ? glyphCanvasPickModule : glyphMathPickModule));
34827
34440
  }
34828
- _registerGlyph.__loaded = !1;
34829
- var registerGlyph = _registerGlyph;
34830
34441
 
34831
- function _registerGroup() {
34832
- _registerGroup.__loaded || (_registerGroup.__loaded = !0, registerGroupGraphic());
34442
+ var loaded$c = !1;
34443
+ function registerGroup() {
34444
+ loaded$c || (loaded$c = !0, registerGroupGraphic());
34833
34445
  }
34834
- _registerGroup.__loaded = !1;
34835
- var registerGroup = _registerGroup;
34836
34446
 
34837
- function _registerImage() {
34838
- _registerImage.__loaded || (_registerImage.__loaded = !0, registerImageGraphic(), container.load(imageModule), container.load(browser ? imageCanvasPickModule : imageMathPickModule));
34447
+ var loaded$b = !1;
34448
+ function registerImage() {
34449
+ loaded$b || (loaded$b = !0, registerImageGraphic(), container.load(imageModule), container.load(browser ? imageCanvasPickModule : imageMathPickModule));
34839
34450
  }
34840
- _registerImage.__loaded = !1;
34841
- var registerImage = _registerImage;
34842
34451
 
34843
- function _registerLine() {
34844
- _registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser ? lineCanvasPickModule : lineMathPickModule));
34452
+ var loaded$a = !1;
34453
+ function registerLine() {
34454
+ loaded$a || (loaded$a = !0, registerLineGraphic(), container.load(lineModule), container.load(browser ? lineCanvasPickModule : lineMathPickModule));
34845
34455
  }
34846
- _registerLine.__loaded = !1;
34847
- var registerLine = _registerLine;
34848
34456
 
34849
- function _registerPath() {
34850
- _registerPath.__loaded || (_registerPath.__loaded = !0, registerPathGraphic(), container.load(pathModule), container.load(browser ? pathCanvasPickModule : pathMathPickModule));
34457
+ var loaded$9 = !1;
34458
+ function registerPath() {
34459
+ loaded$9 || (loaded$9 = !0, registerPathGraphic(), container.load(pathModule), container.load(browser ? pathCanvasPickModule : pathMathPickModule));
34851
34460
  }
34852
- _registerPath.__loaded = !1;
34853
- var registerPath = _registerPath;
34854
34461
 
34855
- function _registerPolygon() {
34856
- _registerPolygon.__loaded || (_registerPolygon.__loaded = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser ? polygonCanvasPickModule : polygonMathPickModule));
34462
+ var loaded$8 = !1;
34463
+ function registerPolygon() {
34464
+ loaded$8 || (loaded$8 = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser ? polygonCanvasPickModule : polygonMathPickModule));
34857
34465
  }
34858
- _registerPolygon.__loaded = !1;
34859
- var registerPolygon = _registerPolygon;
34860
34466
 
34861
- function _registerPyramid3d() {
34862
- _registerPyramid3d.__loaded || (_registerPyramid3d.__loaded = !0, registerPyramid3dGraphic(), container.load(pyramid3dModule), container.load(pyramid3dCanvasPickModule));
34467
+ var loaded$7 = !1;
34468
+ function registerPyramid3d() {
34469
+ loaded$7 || (loaded$7 = !0, registerPyramid3dGraphic(), container.load(pyramid3dModule), container.load(pyramid3dCanvasPickModule));
34863
34470
  }
34864
- _registerPyramid3d.__loaded = !1;
34865
- var registerPyramid3d = _registerPyramid3d;
34866
34471
 
34867
- function _registerRect() {
34868
- _registerRect.__loaded || (_registerRect.__loaded = !0, registerRectGraphic(), container.load(rectModule), container.load(browser ? rectCanvasPickModule : rectMathPickModule));
34472
+ var loaded$6 = !1;
34473
+ function registerRect() {
34474
+ loaded$6 || (loaded$6 = !0, registerRectGraphic(), container.load(rectModule), container.load(browser ? rectCanvasPickModule : rectMathPickModule));
34869
34475
  }
34870
- _registerRect.__loaded = !1;
34871
- var registerRect = _registerRect;
34872
34476
 
34873
- function _registerRect3d() {
34874
- _registerRect3d.__loaded || (_registerRect3d.__loaded = !0, registerRect3dGraphic(), container.load(rect3dModule), container.load(rect3dCanvasPickModule));
34477
+ var loaded$5 = !1;
34478
+ function registerRect3d() {
34479
+ loaded$5 || (loaded$5 = !0, registerRect3dGraphic(), container.load(rect3dModule), container.load(rect3dCanvasPickModule));
34875
34480
  }
34876
- _registerRect3d.__loaded = !1;
34877
- var registerRect3d = _registerRect3d;
34878
34481
 
34879
- function _registerRichtext() {
34880
- _registerRichtext.__loaded || (_registerRichtext.__loaded = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser ? richtextCanvasPickModule : richTextMathPickModule));
34482
+ var loaded$4 = !1;
34483
+ function registerRichtext() {
34484
+ loaded$4 || (loaded$4 = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser ? richtextCanvasPickModule : richTextMathPickModule));
34881
34485
  }
34882
- _registerRichtext.__loaded = !1;
34883
- var registerRichtext = _registerRichtext;
34884
34486
 
34885
- function _registerShadowRoot() {
34886
- _registerShadowRoot.__loaded || (_registerShadowRoot.__loaded = !0, registerShadowRootGraphic());
34487
+ var loaded$3 = !1;
34488
+ function registerShadowRoot() {
34489
+ loaded$3 || (loaded$3 = !0, registerShadowRootGraphic());
34887
34490
  }
34888
- _registerShadowRoot.__loaded = !1;
34889
- var registerShadowRoot = _registerShadowRoot;
34890
34491
 
34891
- function _registerSymbol() {
34892
- _registerSymbol.__loaded || (_registerSymbol.__loaded = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser ? symbolCanvasPickModule : symbolMathPickModule));
34492
+ var loaded$2 = !1;
34493
+ function registerSymbol() {
34494
+ loaded$2 || (loaded$2 = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser ? symbolCanvasPickModule : symbolMathPickModule));
34893
34495
  }
34894
- _registerSymbol.__loaded = !1;
34895
- var registerSymbol = _registerSymbol;
34896
34496
 
34897
- function _registerText() {
34898
- _registerText.__loaded || (_registerText.__loaded = !0, registerTextGraphic(), container.load(textModule), container.load(browser ? textCanvasPickModule : textMathPickModule));
34497
+ var loaded$1 = !1;
34498
+ function registerText() {
34499
+ loaded$1 || (loaded$1 = !0, registerTextGraphic(), container.load(textModule), container.load(browser ? textCanvasPickModule : textMathPickModule));
34899
34500
  }
34900
- _registerText.__loaded = !1;
34901
- var registerText = _registerText;
34902
34501
 
34903
- function _registerWrapText() {
34904
- _registerWrapText.__loaded || (_registerWrapText.__loaded = !0, registerWrapTextGraphic());
34502
+ var loaded = !1;
34503
+ function registerWrapText() {
34504
+ loaded || (loaded = !0, registerWrapTextGraphic());
34905
34505
  }
34906
- _registerWrapText.__loaded = !1;
34907
- var registerWrapText = _registerWrapText;
34908
34506
 
34909
34507
  var roughModule = _roughModule;
34910
34508
 
34911
- const version = "0.17.19-alpha.1";
34509
+ const version = "0.18.0-alpha.0";
34912
34510
  preLoadAllModule();
34913
34511
  if (isBrowserEnv()) {
34914
34512
  loadBrowserEnv(container);
@@ -34959,7 +34557,6 @@
34959
34557
  exports.BoundsContext = BoundsContext;
34960
34558
  exports.BoundsPicker = BoundsPicker;
34961
34559
  exports.CIRCLE_NUMBER_TYPE = CIRCLE_NUMBER_TYPE;
34962
- exports.Canvas3DDrawItemInterceptor = Canvas3DDrawItemInterceptor;
34963
34560
  exports.CanvasFactory = CanvasFactory;
34964
34561
  exports.CanvasTextLayout = CanvasTextLayout;
34965
34562
  exports.CbAnimate = CbAnimate;
@@ -34981,13 +34578,11 @@
34981
34578
  exports.CustomEvent = CustomEvent;
34982
34579
  exports.CustomPath2D = CustomPath2D;
34983
34580
  exports.CustomSymbolClass = CustomSymbolClass;
34984
- exports.DebugDrawItemInterceptorContribution = DebugDrawItemInterceptorContribution;
34985
34581
  exports.DefaultArcAllocate = DefaultArcAllocate;
34986
34582
  exports.DefaultArcAttribute = DefaultArcAttribute;
34987
34583
  exports.DefaultArcRenderContribution = DefaultArcRenderContribution;
34988
34584
  exports.DefaultAreaAllocate = DefaultAreaAllocate;
34989
34585
  exports.DefaultAreaAttribute = DefaultAreaAttribute;
34990
- exports.DefaultAreaTextureRenderContribution = DefaultAreaTextureRenderContribution;
34991
34586
  exports.DefaultAttribute = DefaultAttribute;
34992
34587
  exports.DefaultBaseBackgroundRenderContribution = DefaultBaseBackgroundRenderContribution;
34993
34588
  exports.DefaultBaseTextureRenderContribution = DefaultBaseTextureRenderContribution;
@@ -35035,7 +34630,6 @@
35035
34630
  exports.DefaultTransform = DefaultTransform;
35036
34631
  exports.DragNDrop = DragNDrop;
35037
34632
  exports.DrawContribution = DrawContribution;
35038
- exports.DrawItemInterceptor = DrawItemInterceptor;
35039
34633
  exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
35040
34634
  exports.EnvContribution = EnvContribution;
35041
34635
  exports.EventManager = EventManager;
@@ -35074,7 +34668,6 @@
35074
34668
  exports.IncreaseCount = IncreaseCount;
35075
34669
  exports.IncrementalDrawContribution = IncrementalDrawContribution;
35076
34670
  exports.InputText = InputText;
35077
- exports.InteractiveDrawItemInterceptorContribution = InteractiveDrawItemInterceptorContribution;
35078
34671
  exports.InteractiveSubRenderContribution = InteractiveSubRenderContribution;
35079
34672
  exports.LINE_NUMBER_TYPE = LINE_NUMBER_TYPE;
35080
34673
  exports.Layer = Layer;
@@ -35136,7 +34729,6 @@
35136
34729
  exports.SYMBOL_NUMBER_TYPE = SYMBOL_NUMBER_TYPE;
35137
34730
  exports.SegContext = SegContext;
35138
34731
  exports.ShadowRoot = ShadowRoot;
35139
- exports.ShadowRootDrawItemInterceptorContribution = ShadowRootDrawItemInterceptorContribution;
35140
34732
  exports.Stage = Stage;
35141
34733
  exports.StaticLayerHandlerContribution = StaticLayerHandlerContribution;
35142
34734
  exports.Step = Step$1;
@@ -35177,7 +34769,6 @@
35177
34769
  exports.WindowHandlerContribution = WindowHandlerContribution;
35178
34770
  exports.WrapText = WrapText;
35179
34771
  exports.XMLParser = XMLParser;
35180
- exports._registerArc = _registerArc;
35181
34772
  exports.addArcToBezierPath = addArcToBezierPath$1;
35182
34773
  exports.addAttributeToPrototype = addAttributeToPrototype;
35183
34774
  exports.alignBezierCurves = alignBezierCurves;
@@ -35291,9 +34882,9 @@
35291
34882
  exports.genLinearSegments = genLinearSegments;
35292
34883
  exports.genLinearTypeSegments = genLinearTypeSegments;
35293
34884
  exports.genMonotoneXSegments = genMonotoneXSegments;
35294
- exports.genMonotoneXTypeSegments = genMonotoneXTypeSegments;
35295
34885
  exports.genMonotoneYSegments = genMonotoneYSegments;
35296
- exports.genMonotoneYTypeSegments = genMonotoneYTypeSegments;
34886
+ exports.genMonotpneXTypeSegments = genMonotpneXTypeSegments;
34887
+ exports.genMonotpneYTypeSegments = genMonotpneYTypeSegments;
35297
34888
  exports.genNumberType = genNumberType;
35298
34889
  exports.genStepSegments = genStepSegments;
35299
34890
  exports.genStepTypeSegments = genStepTypeSegments;