@visactor/vrender 0.17.19 → 0.17.20-alpha.10

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
@@ -2149,15 +2149,15 @@
2149
2149
  };
2150
2150
  var isArray$1 = isArray;
2151
2151
 
2152
- var isNumber$1 = function isNumber(value) {
2152
+ var isNumber = function isNumber(value) {
2153
2153
  var fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
2154
2154
  var type = _typeof(value);
2155
2155
  return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
2156
2156
  };
2157
- var isNumber$2 = isNumber$1;
2157
+ var isNumber$1 = isNumber;
2158
2158
 
2159
2159
  var isValidNumber = function isValidNumber(value) {
2160
- return isNumber$2(value) && Number.isFinite(value);
2160
+ return isNumber$1(value) && Number.isFinite(value);
2161
2161
  };
2162
2162
  var isValidNumber$1 = isValidNumber;
2163
2163
 
@@ -2264,12 +2264,12 @@
2264
2264
  }, {
2265
2265
  key: "add",
2266
2266
  value: function add(point) {
2267
- return isNumber$2(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
2267
+ return isNumber$1(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
2268
2268
  }
2269
2269
  }, {
2270
2270
  key: "sub",
2271
2271
  value: function sub(point) {
2272
- return isNumber$2(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
2272
+ return isNumber$1(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
2273
2273
  }
2274
2274
  }, {
2275
2275
  key: "multi",
@@ -2973,10 +2973,10 @@
2973
2973
  return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
2974
2974
  }
2975
2975
  function rgb(value) {
2976
- return isNumber$2(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
2976
+ return isNumber$1(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
2977
2977
  }
2978
2978
  function rgba(value) {
2979
- return isNumber$2(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
2979
+ return isNumber$1(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
2980
2980
  }
2981
2981
  function SRGBToLinear(c) {
2982
2982
  return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
@@ -3657,7 +3657,7 @@
3657
3657
  }], [{
3658
3658
  key: "getInstance",
3659
3659
  value: function getInstance(level, method) {
3660
- return Logger._instance && isNumber$2(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
3660
+ return Logger._instance && isNumber$1(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
3661
3661
  }
3662
3662
  }, {
3663
3663
  key: "setInstance",
@@ -4784,6 +4784,11 @@
4784
4784
  value: function clear() {
4785
4785
  this.transformCbList = null, this.commandList.length = 0, this.curves.length = 0;
4786
4786
  }
4787
+ }, {
4788
+ key: "beginPath",
4789
+ value: function beginPath() {
4790
+ this.clear();
4791
+ }
4787
4792
  }, {
4788
4793
  key: "toString",
4789
4794
  value: function toString() {
@@ -4803,6 +4808,8 @@
4803
4808
  var path = "";
4804
4809
  for (var i = 0; i < bezierPathList.length; i += 6) path += "C".concat(bezierPathList[i], " ").concat(bezierPathList[i + 1], " ").concat(bezierPathList[i + 2], " ").concat(bezierPathList[i + 3], " ").concat(bezierPathList[i + 4], " ").concat(bezierPathList[i + 5]);
4805
4810
  return path;
4811
+ }, _list[enumCommandMap.R] = function (cmd) {
4812
+ return "M".concat(cmd[1], " ").concat(cmd[2], " h").concat(cmd[3], " v").concat(cmd[4], " H").concat(cmd[1], "Z");
4806
4813
  }, _list[enumCommandMap.Z] = function (cmd) {
4807
4814
  return "Z";
4808
4815
  }, this.toStringCbList = _list;
@@ -5188,6 +5195,7 @@
5188
5195
  zIndex: 0,
5189
5196
  layout: null,
5190
5197
  boundsPadding: 0,
5198
+ renderStyle: "default",
5191
5199
  pickMode: "accurate",
5192
5200
  customPickShape: null,
5193
5201
  boundsMode: "accurate",
@@ -5797,9 +5805,6 @@
5797
5805
  function isNotAroundZero(val) {
5798
5806
  return val > EPSILON || val < -EPSILON;
5799
5807
  }
5800
- function isNumber(data) {
5801
- return "number" == typeof data && Number.isFinite(data);
5802
- }
5803
5808
  var _v0 = [0, 0],
5804
5809
  _v1 = [0, 0],
5805
5810
  _v2 = [0, 0];
@@ -6286,9 +6291,20 @@
6286
6291
  }, {
6287
6292
  key: "create",
6288
6293
  value: function create(params) {
6294
+ var _a, _b;
6289
6295
  this._handler.createWindow(params);
6290
6296
  var windowWH = this._handler.getWH();
6291
- this._width = windowWH.width, this._height = windowWH.height, this.title = this._handler.getTitle(), this.resizable = !0;
6297
+ this._width = windowWH.width, this._height = windowWH.height, params.viewBox ? this.setViewBox(params.viewBox) : !1 !== params.canvasControled ? this.setViewBox({
6298
+ x1: 0,
6299
+ y1: 0,
6300
+ x2: this._width,
6301
+ y2: this._height
6302
+ }) : this.setViewBox({
6303
+ x1: 0,
6304
+ y1: 0,
6305
+ x2: null !== (_a = params.width) && void 0 !== _a ? _a : this._width,
6306
+ y2: null !== (_b = params.height) && void 0 !== _b ? _b : this._height
6307
+ }), this.title = this._handler.getTitle(), this.resizable = !0;
6292
6308
  }
6293
6309
  }, {
6294
6310
  key: "setWindowHandler",
@@ -6357,8 +6373,47 @@
6357
6373
  }
6358
6374
  }, {
6359
6375
  key: "clearViewBox",
6360
- value: function clearViewBox(viewBox, color) {
6361
- this._handler.clearViewBox(viewBox, color);
6376
+ value: function clearViewBox(color) {
6377
+ this._handler.clearViewBox(color);
6378
+ }
6379
+ }, {
6380
+ key: "setViewBox",
6381
+ value: function setViewBox(viewBox) {
6382
+ this._handler.setViewBox(viewBox);
6383
+ }
6384
+ }, {
6385
+ key: "setViewBoxTransform",
6386
+ value: function setViewBoxTransform(a, b, c, d, e, f) {
6387
+ this._handler.setViewBoxTransform(a, b, c, d, e, f);
6388
+ }
6389
+ }, {
6390
+ key: "getViewBox",
6391
+ value: function getViewBox() {
6392
+ return this._handler.getViewBox();
6393
+ }
6394
+ }, {
6395
+ key: "getViewBoxTransform",
6396
+ value: function getViewBoxTransform() {
6397
+ return this._handler.getViewBoxTransform();
6398
+ }
6399
+ }, {
6400
+ key: "pointTransform",
6401
+ value: function pointTransform(x, y) {
6402
+ var vb = this._handler.getViewBox(),
6403
+ nextP = {
6404
+ x: x,
6405
+ y: y
6406
+ };
6407
+ return this._handler.getViewBoxTransform().transformPoint({
6408
+ x: x,
6409
+ y: y
6410
+ }, nextP), nextP.x -= vb.x1, nextP.y -= vb.y1, nextP;
6411
+ }
6412
+ }, {
6413
+ key: "hasSubView",
6414
+ value: function hasSubView() {
6415
+ var viewBox = this._handler.getViewBox();
6416
+ return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width === viewBox.width() && this.height === viewBox.height());
6362
6417
  }
6363
6418
  }, {
6364
6419
  key: "isVisible",
@@ -6476,8 +6531,16 @@
6476
6531
  var window = container.get(VWindow),
6477
6532
  bounds = graphic.AABBBounds,
6478
6533
  width = bounds.width(),
6479
- height = bounds.height();
6534
+ height = bounds.height(),
6535
+ x1 = -bounds.x1,
6536
+ y1 = -bounds.y1;
6480
6537
  window.create({
6538
+ viewBox: {
6539
+ x1: x1,
6540
+ y1: y1,
6541
+ x2: bounds.x2,
6542
+ y2: bounds.y2
6543
+ },
6481
6544
  width: width,
6482
6545
  height: height,
6483
6546
  canvas: canvas,
@@ -6486,14 +6549,10 @@
6486
6549
  offscreen: !0,
6487
6550
  title: ""
6488
6551
  });
6489
- var x = -bounds.x1,
6490
- y = -bounds.y1,
6491
- disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
6552
+ var disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
6492
6553
  stage.params.optimize.disableCheckGraphicWidthOutRange = !0, stage.defaultLayer.getNativeHandler().drawTo(window, [graphic], {
6493
- x: x,
6494
- y: y,
6495
- width: width,
6496
- height: height,
6554
+ transMatrix: window.getViewBoxTransform(),
6555
+ viewBox: window.getViewBox(),
6497
6556
  stage: stage,
6498
6557
  layer: stage.defaultLayer,
6499
6558
  renderService: stage.renderService,
@@ -6710,7 +6769,7 @@
6710
6769
  }();
6711
6770
  var globalTheme = new Theme();
6712
6771
  function getTheme(graphic, theme) {
6713
- return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || globalTheme.getTheme();
6772
+ return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic) || globalTheme.getTheme();
6714
6773
  }
6715
6774
  function getThemeFromGroup(graphic) {
6716
6775
  var g;
@@ -6974,10 +7033,13 @@
6974
7033
  }
6975
7034
  }, {
6976
7035
  key: "removeAllChild",
6977
- value: function removeAllChild() {
7036
+ value: function removeAllChild(deep) {
6978
7037
  if (!this._idMap) return;
6979
7038
  var child = this._firstChild;
6980
- for (; child;) child.parent = null, child._prev = null, child._next = null, child = child._next;
7039
+ for (; child;) {
7040
+ var next = child._next;
7041
+ child.parent = null, child._prev = null, child._next = null, child = child._next, child = next;
7042
+ }
6981
7043
  this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
6982
7044
  }
6983
7045
  }, {
@@ -7655,7 +7717,7 @@
7655
7717
  var mappers = this.mappingTable[e.type];
7656
7718
  var target;
7657
7719
  var cacheKey = "".concat(e.canvasX, "-").concat(e.canvasY);
7658
- if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY, e), e.pickParams || (this._prePointTargetCache = _defineProperty(_defineProperty({}, cacheKey, target), "stageRenderCount", null !== (_g = null == target ? void 0 : target.stage.renderCount) && void 0 !== _g ? _g : -1))), mappers) for (var i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else Logger.getInstance().warn("[EventManager]: Event mapping not defined for ".concat(e.type));
7720
+ if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.viewX, e.viewY, e), e.pickParams || (this._prePointTargetCache = _defineProperty(_defineProperty({}, cacheKey, target), "stageRenderCount", null !== (_g = null == target ? void 0 : target.stage.renderCount) && void 0 !== _g ? _g : -1))), mappers) for (var i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else Logger.getInstance().warn("[EventManager]: Event mapping not defined for ".concat(e.type));
7659
7721
  }
7660
7722
  }, {
7661
7723
  key: "propagate",
@@ -7697,14 +7759,16 @@
7697
7759
  }, {
7698
7760
  key: "createPointerEvent",
7699
7761
  value: function createPointerEvent(from, type, target) {
7762
+ var _a, _b;
7700
7763
  var event = this.allocateEvent(FederatedPointerEvent);
7701
- return this.copyPointerData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(event.global.x, event.global.y, event), "string" == typeof type && (event.type = type), event;
7764
+ return this.copyPointerData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(null !== (_a = event.viewX) && void 0 !== _a ? _a : event.global.x, null !== (_b = event.viewY) && void 0 !== _b ? _b : event.global.y, event), "string" == typeof type && (event.type = type), event;
7702
7765
  }
7703
7766
  }, {
7704
7767
  key: "createWheelEvent",
7705
7768
  value: function createWheelEvent(from, target) {
7769
+ var _a, _b;
7706
7770
  var event = this.allocateEvent(FederatedWheelEvent);
7707
- return this.copyWheelData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(event.global.x, event.global.y, event), event;
7771
+ return this.copyWheelData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(null !== (_a = event.viewX) && void 0 !== _a ? _a : event.global.x, null !== (_b = event.viewY) && void 0 !== _b ? _b : event.global.y, event), event;
7708
7772
  }
7709
7773
  }, {
7710
7774
  key: "clonePointerEvent",
@@ -7834,7 +7898,7 @@
7834
7898
  _this.setCursor(_this.manager.cursor, _this.manager.cursorTarget);
7835
7899
  }, this.onPointerUp = function (nativeEvent) {
7836
7900
  if (_this.supportsTouchEvents && "touch" === nativeEvent.pointerType) return;
7837
- var outside = _this.isEventOutsideOfTargetElement(nativeEvent) ? "outside" : "",
7901
+ var outside = _this.isEventOutsideOfTargetViewPort(nativeEvent) ? "outside" : "",
7838
7902
  normalizedEvents = _this.normalizeToPointerData(nativeEvent);
7839
7903
  for (var i = 0, j = normalizedEvents.length; i < j; i++) {
7840
7904
  var event = _this.bootstrapEvent(_this.rootPointerEvent, normalizedEvents[i]);
@@ -7857,7 +7921,6 @@
7857
7921
  resolution = params.resolution,
7858
7922
  rootNode = params.rootNode,
7859
7923
  global = params.global,
7860
- viewport = params.viewport,
7861
7924
  _params$autoPreventDe = params.autoPreventDefault,
7862
7925
  autoPreventDefault = _params$autoPreventDe === void 0 ? !1 : _params$autoPreventDe,
7863
7926
  clickInterval = params.clickInterval,
@@ -7867,7 +7930,7 @@
7867
7930
  supportsPointerEvents = _params$supportsPoint === void 0 ? global.supportsPointerEvents : _params$supportsPoint;
7868
7931
  this.manager = new EventManager(rootNode, {
7869
7932
  clickInterval: clickInterval
7870
- }), 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 = {
7933
+ }), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
7871
7934
  "default": "inherit",
7872
7935
  pointer: "pointer"
7873
7936
  }, this.resolution = resolution, this.setTargetElement(targetElement);
@@ -7915,13 +7978,7 @@
7915
7978
  }, {
7916
7979
  key: "mapToViewportPoint",
7917
7980
  value: function mapToViewportPoint(event) {
7918
- var viewport = this.viewport,
7919
- x = event.x,
7920
- y = event.y;
7921
- return {
7922
- x: x - viewport.x,
7923
- y: y - viewport.y
7924
- };
7981
+ return this.domElement.pointTransform ? this.domElement.pointTransform(event.x, event.y) : event;
7925
7982
  }
7926
7983
  }, {
7927
7984
  key: "mapToCanvasPoint",
@@ -7982,6 +8039,19 @@
7982
8039
  value: function transferMouseData(event, nativeEvent) {
7983
8040
  event.isTrusted = nativeEvent.isTrusted, event.srcElement = nativeEvent.srcElement, event.timeStamp = clock.now(), event.type = nativeEvent.type, event.altKey = nativeEvent.altKey, event.button = nativeEvent.button, event.buttons = nativeEvent.buttons, event.client.x = nativeEvent.clientX, event.client.y = nativeEvent.clientY, event.ctrlKey = nativeEvent.ctrlKey, event.shiftKey = nativeEvent.shiftKey, event.metaKey = nativeEvent.metaKey, event.movement.x = nativeEvent.movementX, event.movement.y = nativeEvent.movementY, event.page.x = nativeEvent.pageX, event.page.y = nativeEvent.pageY, event.relatedTarget = null;
7984
8041
  }
8042
+ }, {
8043
+ key: "isEventOutsideOfTargetViewPort",
8044
+ value: function isEventOutsideOfTargetViewPort(nativeEvent) {
8045
+ if (this.isEventOutsideOfTargetElement(nativeEvent)) return !0;
8046
+ if (this.domElement.getViewBox) {
8047
+ var p = this.mapToViewportPoint(this.mapToCanvasPoint(nativeEvent)),
8048
+ b = this.domElement.getViewBox(),
8049
+ w = b.width(),
8050
+ h = b.height();
8051
+ return !(p.x < w && p.y < h && p.x > 0 && p.y > 0);
8052
+ }
8053
+ return !1;
8054
+ }
7985
8055
  }, {
7986
8056
  key: "isEventOutsideOfTargetElement",
7987
8057
  value: function isEventOutsideOfTargetElement(nativeEvent) {
@@ -9243,7 +9313,7 @@
9243
9313
  key: "onBind",
9244
9314
  value: function onBind() {
9245
9315
  var _a, _b, _c, _d, _e, _f, _g, _h;
9246
- this.fromNumber = isNumber$2(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$2(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1), !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
9316
+ this.fromNumber = isNumber$1(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$1(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1), !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
9247
9317
  }
9248
9318
  }, {
9249
9319
  key: "onEnd",
@@ -10654,7 +10724,7 @@
10654
10724
  };
10655
10725
  var samplingPoints = function samplingPoints(points, count) {
10656
10726
  var validatePoints = points.filter(function (point) {
10657
- return !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y);
10727
+ return !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y);
10658
10728
  });
10659
10729
  if (0 === validatePoints.length) return [];
10660
10730
  if (1 === validatePoints.length) return new Array(count).fill(0).map(function (i) {
@@ -10694,7 +10764,7 @@
10694
10764
  return res.concat(null !== (_a = seg.points) && void 0 !== _a ? _a : []);
10695
10765
  }, []));
10696
10766
  var validatePoints = points.filter(function (point) {
10697
- return !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y);
10767
+ return !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y);
10698
10768
  });
10699
10769
  if (!validatePoints.length) return [];
10700
10770
  var allPoints = [];
@@ -11361,15 +11431,7 @@
11361
11431
  var data = ResourceLoader.cache.get(url);
11362
11432
  data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(function () {
11363
11433
  mark.imageLoadFail(url);
11364
- }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (data = {
11365
- type: "image",
11366
- loadState: "init"
11367
- }, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(function (res) {
11368
- var _a;
11369
- 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) {
11370
- (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
11371
- });
11372
- })) : (data.loadState = "fail", mark.imageLoadFail(url)));
11434
+ }) : "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);
11373
11435
  }
11374
11436
  }, {
11375
11437
  key: "GetSvg",
@@ -11403,10 +11465,68 @@
11403
11465
  return data.data;
11404
11466
  }));
11405
11467
  }
11468
+ }, {
11469
+ key: "loading",
11470
+ value: function loading() {
11471
+ setTimeout(function () {
11472
+ if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
11473
+ ResourceLoader.isLoading = !0;
11474
+ var tasks = ResourceLoader.toLoadAueue.splice(0, 10),
11475
+ promises = [];
11476
+ tasks.forEach(function (task) {
11477
+ var url = task.url,
11478
+ marks = task.marks,
11479
+ data = {
11480
+ type: "image",
11481
+ loadState: "init"
11482
+ };
11483
+ if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
11484
+ data.waitingMark = marks;
11485
+ var end = data.dataPromise.then(function (res) {
11486
+ var _a;
11487
+ 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) {
11488
+ (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
11489
+ });
11490
+ });
11491
+ promises.push(end);
11492
+ } else data.loadState = "fail", marks.forEach(function (mark) {
11493
+ return mark.imageLoadFail(url);
11494
+ });
11495
+ }), Promise.all(promises).then(function () {
11496
+ ResourceLoader.isLoading = !1, ResourceLoader.loading();
11497
+ })["catch"](function (error) {
11498
+ console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
11499
+ });
11500
+ }
11501
+ }, 0);
11502
+ }
11503
+ }, {
11504
+ key: "loadImage",
11505
+ value: function loadImage(url, mark) {
11506
+ var index = getIndex(url, ResourceLoader.toLoadAueue);
11507
+ if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
11508
+ ResourceLoader.toLoadAueue.push({
11509
+ url: url,
11510
+ marks: [mark]
11511
+ }), ResourceLoader.loading();
11512
+ }
11513
+ }, {
11514
+ key: "improveImageLoading",
11515
+ value: function improveImageLoading(url) {
11516
+ var index = getIndex(url, ResourceLoader.toLoadAueue);
11517
+ if (-1 !== index) {
11518
+ var elememt = ResourceLoader.toLoadAueue.splice(index, 1);
11519
+ ResourceLoader.toLoadAueue.unshift(elememt[0]);
11520
+ }
11521
+ }
11406
11522
  }]);
11407
11523
  return ResourceLoader;
11408
11524
  }();
11409
- ResourceLoader.cache = new Map();
11525
+ function getIndex(url, arr) {
11526
+ for (var i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
11527
+ return -1;
11528
+ }
11529
+ ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
11410
11530
 
11411
11531
  var tempMatrix = new Matrix(),
11412
11532
  tempBounds$1 = new AABBBounds();
@@ -11524,7 +11644,7 @@
11524
11644
  if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
11525
11645
  application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
11526
11646
  var bounds = this.doUpdateAABBBounds(full);
11527
- return this.addUpdateLayoutTag(), application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
11647
+ return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
11528
11648
  }
11529
11649
  }, {
11530
11650
  key: "combindShadowAABBBounds",
@@ -11537,7 +11657,8 @@
11537
11657
  }, {
11538
11658
  key: "tryUpdateGlobalAABBBounds",
11539
11659
  value: function tryUpdateGlobalAABBBounds() {
11540
- return this._globalAABBBounds ? this._globalAABBBounds.setValue(this._AABBBounds.x1, this._AABBBounds.y1, this._AABBBounds.x2, this._AABBBounds.y2) : this._globalAABBBounds = this.AABBBounds.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
11660
+ var b = this.AABBBounds;
11661
+ return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
11541
11662
  }
11542
11663
  }, {
11543
11664
  key: "tryUpdateGlobalTransMatrix",
@@ -12192,7 +12313,7 @@
12192
12313
  data: "init",
12193
12314
  state: null
12194
12315
  };
12195
- 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);
12316
+ 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
12317
  }
12197
12318
  }, {
12198
12319
  key: "imageLoadSuccess",
@@ -12843,8 +12964,9 @@
12843
12964
  }, {
12844
12965
  key: "removeAllChild",
12845
12966
  value: function removeAllChild() {
12967
+ var deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
12846
12968
  this.forEachChildren(function (child) {
12847
- application.graphicService.onRemove(child);
12969
+ application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
12848
12970
  }), _get(_getPrototypeOf(Group.prototype), "removeAllChild", this).call(this), this.addUpdateBoundTag();
12849
12971
  }
12850
12972
  }, {
@@ -13020,15 +13142,12 @@
13020
13142
  value: function render(params, userParams) {
13021
13143
  var _this4 = this;
13022
13144
  var _a;
13023
- var stage = this.stage;
13024
13145
  this.layerHandler.render([this], {
13025
13146
  renderService: params.renderService,
13026
- x: stage.x,
13027
- y: stage.y,
13028
- width: this.viewWidth,
13029
- height: this.viewHeight,
13030
13147
  stage: this.stage,
13031
13148
  layer: this,
13149
+ viewBox: params.viewBox,
13150
+ transMatrix: params.transMatrix,
13032
13151
  background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
13033
13152
  updateBounds: params.updateBounds
13034
13153
  }, userParams), this.afterDrawCbs.forEach(function (c) {
@@ -13068,48 +13187,28 @@
13068
13187
  }, {
13069
13188
  key: "prepare",
13070
13189
  value: function prepare(dirtyBounds, params) {}
13071
- }, {
13072
- key: "combineTo",
13073
- value: function combineTo(target, params) {
13074
- var _this5 = this;
13075
- var _a, _b, _c;
13076
- this.offscreen && (this.layerHandler.drawTo(target, [this], Object.assign({
13077
- background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
13078
- renderService: params.renderService,
13079
- x: null !== (_b = params.x) && void 0 !== _b ? _b : this.stage.x,
13080
- y: null !== (_c = params.y) && void 0 !== _c ? _c : this.stage.y,
13081
- width: this.viewWidth,
13082
- height: this.viewHeight,
13083
- stage: this.stage,
13084
- layer: this
13085
- }, params)), this.afterDrawCbs.forEach(function (c) {
13086
- return c(_this5);
13087
- }));
13088
- }
13089
13190
  }, {
13090
13191
  key: "release",
13091
13192
  value: function release() {
13092
- var _this6 = this;
13193
+ var _this5 = this;
13093
13194
  _get(_getPrototypeOf(Layer.prototype), "release", this).call(this), this.layerHandler.release(), this.subLayers && this.subLayers.forEach(function (l) {
13094
- application.layerService.releaseLayer(_this6.stage, l.layer);
13195
+ application.layerService.releaseLayer(_this5.stage, l.layer);
13095
13196
  });
13096
13197
  }
13097
13198
  }, {
13098
13199
  key: "drawTo",
13099
13200
  value: function drawTo(target, params) {
13100
- var _this7 = this;
13101
- var _a, _b, _c;
13201
+ var _this6 = this;
13202
+ var _a;
13102
13203
  this.layerHandler.drawTo(target, [this], Object.assign({
13103
13204
  background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
13104
13205
  renderService: params.renderService,
13105
- x: null !== (_b = params.x) && void 0 !== _b ? _b : this.stage.x,
13106
- y: null !== (_c = params.y) && void 0 !== _c ? _c : this.stage.y,
13107
- width: this.viewWidth,
13108
- height: this.viewHeight,
13206
+ viewBox: params.viewBox,
13207
+ transMatrix: params.transMatrix,
13109
13208
  stage: this.stage,
13110
13209
  layer: this
13111
13210
  }, params)), this.afterDrawCbs.forEach(function (c) {
13112
- return c(_this7);
13211
+ return c(_this6);
13113
13212
  });
13114
13213
  }
13115
13214
  }]);
@@ -14510,7 +14609,7 @@
14510
14609
  _createClass(BaseSymbol, [{
14511
14610
  key: "bounds",
14512
14611
  value: function bounds(size, _bounds) {
14513
- if (isNumber$2(size)) {
14612
+ if (isNumber$1(size)) {
14514
14613
  var halfS = size / 2;
14515
14614
  _bounds.x1 = -halfS, _bounds.x2 = halfS, _bounds.y1 = -halfS, _bounds.y2 = halfS;
14516
14615
  } else _bounds.x1 = -size[0] / 2, _bounds.x2 = size[0] / 2, _bounds.y1 = -size[1] / 2, _bounds.y2 = size[1] / 2;
@@ -15197,12 +15296,12 @@
15197
15296
  _createClass(RectSymbol, [{
15198
15297
  key: "draw",
15199
15298
  value: function draw(ctx, size, x, y) {
15200
- return isNumber$2(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
15299
+ return isNumber$1(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
15201
15300
  }
15202
15301
  }, {
15203
15302
  key: "drawOffset",
15204
15303
  value: function drawOffset(ctx, size, x, y, offset) {
15205
- return isNumber$2(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
15304
+ return isNumber$1(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
15206
15305
  }
15207
15306
  }]);
15208
15307
  return RectSymbol;
@@ -15841,16 +15940,7 @@
15841
15940
  deltaY = -height;
15842
15941
  }
15843
15942
  var deltaX = 0;
15844
- switch (this.globalAlign) {
15845
- case "left":
15846
- deltaX = 0;
15847
- break;
15848
- case "center":
15849
- deltaX = -width / 2;
15850
- break;
15851
- case "right":
15852
- deltaX = -width;
15853
- }
15943
+ "right" === this.globalAlign || "end" === this.globalAlign ? deltaX = -width : "center" === this.globalAlign && (deltaX = -width / 2);
15854
15944
  var frameHeight = this[this.directionKey.height];
15855
15945
  this.singleLine && (frameHeight = this.lines[0].height + 1);
15856
15946
  var lastLineTag = !1;
@@ -16003,9 +16093,9 @@
16003
16093
  var direction = this.direction;
16004
16094
  if (this.verticalEllipsis) text = "...", direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
16005
16095
  if ("hide" === this.ellipsis) return;
16006
- if ("add" === this.ellipsis) text += "...", "right" === textAlign && (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
16096
+ if ("add" === this.ellipsis) text += "...", "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
16007
16097
  var index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
16008
- if (text = text.slice(0, index), text += "...", "right" === textAlign) {
16098
+ if (text = text.slice(0, index), text += "...", "right" === textAlign || "end" === textAlign) {
16009
16099
  var _measureTextCanvas3 = measureTextCanvas(this.text.slice(index), this.character),
16010
16100
  width = _measureTextCanvas3.width;
16011
16101
  "vertical" === direction || (left -= this.ellipsisWidth - width);
@@ -16261,17 +16351,7 @@
16261
16351
  maxHeight = this.height;
16262
16352
  var x = this.left,
16263
16353
  spacing = 0;
16264
- if (this.actualWidth < width && !isWidthMax) switch (this.textAlign) {
16265
- case "right":
16266
- x = width - this.actualWidth;
16267
- break;
16268
- case "center":
16269
- x = (width - this.actualWidth) / 2;
16270
- break;
16271
- case "justify":
16272
- this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1);
16273
- }
16274
- this.paragraphs.map(function (paragraph) {
16354
+ this.actualWidth < width && !isWidthMax && ("right" === this.textAlign || "end" === this.textAlign ? x = width - this.actualWidth : "center" === this.textAlign ? x = (width - this.actualWidth) / 2 : "justify" === this.textAlign && (this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1))), this.paragraphs.map(function (paragraph) {
16275
16355
  paragraph instanceof RichTextIcon ? (paragraph["_" + directionKey.x] = x, x += paragraph[directionKey.width] + spacing, paragraph["_" + directionKey.y] = "top" === paragraph.attribute.textBaseline ? 0 : "bottom" === paragraph.attribute.textBaseline ? maxHeight - paragraph.height : (maxHeight - paragraph.height) / 2) : (paragraph[directionKey.left] = x, x += paragraph[directionKey.width] + spacing);
16276
16356
  });
16277
16357
  }
@@ -16554,10 +16634,10 @@
16554
16634
  }
16555
16635
  } else {
16556
16636
  var richTextConfig = textConfig[i];
16557
- if (isNumber$2(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text.includes("\n")) {
16637
+ if (isNumber$1(richTextConfig.text) && (richTextConfig.text = "".concat(richTextConfig.text)), richTextConfig.text && richTextConfig.text.includes("\n")) {
16558
16638
  var textParts = richTextConfig.text.split("\n");
16559
16639
  for (var j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
16560
- } else paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
16640
+ } else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
16561
16641
  }
16562
16642
  var maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
16563
16643
  maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
@@ -16883,7 +16963,7 @@
16883
16963
  innerRadius = _this$attribute2$inne === void 0 ? arcTheme.innerRadius : _this$attribute2$inne;
16884
16964
  if (0 === cornerRadius || "0%" === cornerRadius) return 0;
16885
16965
  var deltaRadius = Math.abs(outerRadius - innerRadius);
16886
- return Math.min(isNumber$2(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
16966
+ return Math.min(isNumber$1(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
16887
16967
  }
16888
16968
  }, {
16889
16969
  key: "getParsedAngle",
@@ -19134,7 +19214,7 @@
19134
19214
  var halfPi = pi / 2;
19135
19215
  function createRectPath(path, x, y, width, height, rectCornerRadius) {
19136
19216
  var cornerRadius;
19137
- if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$2(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
19217
+ if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
19138
19218
  var cornerRadiusArr = rectCornerRadius;
19139
19219
  var cr0, cr1;
19140
19220
  switch (cornerRadiusArr.length) {
@@ -19257,7 +19337,7 @@
19257
19337
  y = bounds.y1,
19258
19338
  width = bounds.width(),
19259
19339
  height = bounds.height();
19260
- return isNumber$2(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
19340
+ return isNumber$1(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
19261
19341
  x: x,
19262
19342
  y: y,
19263
19343
  width: width,
@@ -20217,9 +20297,10 @@
20217
20297
  key: "drawLinearAreaHighPerformance",
20218
20298
  value: function drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
20219
20299
  var _a, _b, _c, _d, _e;
20300
+ var points = area.attribute.points;
20301
+ if (points.length < 2) return;
20220
20302
  context.beginPath();
20221
20303
  var z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
20222
- points = area.attribute.points,
20223
20304
  startP = points[0];
20224
20305
  context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
20225
20306
  for (var i = 1; i < points.length; i++) {
@@ -20396,6 +20477,7 @@
20396
20477
  key: "_drawSegmentItem",
20397
20478
  value: function _drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, connect, fillCb, strokeCb) {
20398
20479
  var _a, _b, _c, _d;
20480
+ if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
20399
20481
  var connectedType = attribute.connectedType,
20400
20482
  connectedX = attribute.connectedX,
20401
20483
  connectedY = attribute.connectedY,
@@ -20404,7 +20486,6 @@
20404
20486
  if (connect && (isArray$1(defaultAttribute) ? (connectedType = null !== (_a = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _a ? _a : defaultAttribute[1].connectedType, connectedX = null !== (_b = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _b ? _b : defaultAttribute[1].connectedX, connectedY = null !== (_c = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _c ? _c : defaultAttribute[1].connectedY, connectedStyle = null !== (_d = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _d ? _d : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), isArray$1(defaultAttribute) ? defaultAttribute.forEach(function (i) {
20405
20487
  return da.push(i);
20406
20488
  }) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
20407
- if (!cache) return;
20408
20489
  context.beginPath();
20409
20490
  var _area$attribute4 = area.attribute,
20410
20491
  points = _area$attribute4.points,
@@ -21199,7 +21280,9 @@
21199
21280
  value: function draw(image, renderService, drawContext) {
21200
21281
  var url = image.attribute.image;
21201
21282
  if (!url || !image.resources) return;
21202
- if ("success" !== image.resources.get(url).state) return;
21283
+ var res = image.resources.get(url);
21284
+ if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
21285
+ if ("success" !== res.state) return;
21203
21286
  var context = renderService.drawParams.context;
21204
21287
  if (!context) return;
21205
21288
  var imageAttribute = getTheme(image).image;
@@ -21240,6 +21323,241 @@
21240
21323
  },
21241
21324
  __metadata$$ = undefined && undefined.__metadata || function (k, v) {
21242
21325
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21326
+ };
21327
+ var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
21328
+ var tempDirtyBounds = new AABBBounds();
21329
+ var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
21330
+ function ShadowRootDrawItemInterceptorContribution() {
21331
+ _classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
21332
+ this.order = 1;
21333
+ }
21334
+ _createClass(ShadowRootDrawItemInterceptorContribution, [{
21335
+ key: "afterDrawItem",
21336
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21337
+ return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21338
+ }
21339
+ }, {
21340
+ key: "beforeDrawItem",
21341
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21342
+ return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21343
+ }
21344
+ }, {
21345
+ key: "drawItem",
21346
+ value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21347
+ if (!graphic.shadowRoot) return !1;
21348
+ var context = drawContext.context;
21349
+ if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
21350
+ tempDirtyBounds.copy(drawContribution.dirtyBounds);
21351
+ var m = graphic.globalTransMatrix.getInverse();
21352
+ drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
21353
+ }
21354
+ return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
21355
+ }
21356
+ }]);
21357
+ return ShadowRootDrawItemInterceptorContribution;
21358
+ }();
21359
+ var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
21360
+ function DebugDrawItemInterceptorContribution() {
21361
+ _classCallCheck(this, DebugDrawItemInterceptorContribution);
21362
+ this.order = 1;
21363
+ }
21364
+ _createClass(DebugDrawItemInterceptorContribution, [{
21365
+ key: "afterDrawItem",
21366
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21367
+ return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21368
+ }
21369
+ }, {
21370
+ key: "drawItem",
21371
+ value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21372
+ if (!graphic.attribute._debug_bounds) return !1;
21373
+ var context = drawContext.context;
21374
+ context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
21375
+ var b = graphic.AABBBounds;
21376
+ 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;
21377
+ }
21378
+ }]);
21379
+ return DebugDrawItemInterceptorContribution;
21380
+ }();
21381
+ exports.CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
21382
+ function CommonDrawItemInterceptorContribution() {
21383
+ _classCallCheck(this, CommonDrawItemInterceptorContribution);
21384
+ this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
21385
+ }
21386
+ _createClass(CommonDrawItemInterceptorContribution, [{
21387
+ key: "afterDrawItem",
21388
+ value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21389
+ 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;
21390
+ return !1;
21391
+ }
21392
+ }, {
21393
+ key: "beforeDrawItem",
21394
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21395
+ if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
21396
+ 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;
21397
+ return !1;
21398
+ }
21399
+ }]);
21400
+ return CommonDrawItemInterceptorContribution;
21401
+ }();
21402
+ exports.CommonDrawItemInterceptorContribution = __decorate$1j([injectable(), __metadata$$("design:paramtypes", [])], exports.CommonDrawItemInterceptorContribution);
21403
+ var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
21404
+ function InteractiveDrawItemInterceptorContribution() {
21405
+ _classCallCheck(this, InteractiveDrawItemInterceptorContribution);
21406
+ this.order = 1;
21407
+ }
21408
+ _createClass(InteractiveDrawItemInterceptorContribution, [{
21409
+ key: "beforeDrawItem",
21410
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21411
+ return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
21412
+ }
21413
+ }, {
21414
+ key: "beforeSetInteractive",
21415
+ value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
21416
+ var interactiveGraphic = graphic.interactiveGraphic;
21417
+ if (graphic.attribute.globalZIndex) {
21418
+ interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
21419
+ globalZIndex: 0,
21420
+ zIndex: graphic.attribute.globalZIndex
21421
+ }, !1, {
21422
+ skipUpdateCallback: !0
21423
+ }), drawContext.stage.tryInitInteractiveLayer();
21424
+ var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21425
+ if (interactiveLayer) {
21426
+ this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
21427
+ }
21428
+ return !0;
21429
+ }
21430
+ if (interactiveGraphic) {
21431
+ drawContext.stage.tryInitInteractiveLayer();
21432
+ var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21433
+ if (_interactiveLayer) {
21434
+ this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
21435
+ }
21436
+ graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
21437
+ }
21438
+ return !1;
21439
+ }
21440
+ }, {
21441
+ key: "beforeDrawInteractive",
21442
+ value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
21443
+ var baseGraphic = graphic.baseGraphic;
21444
+ if (baseGraphic) {
21445
+ this.processing = !0;
21446
+ var context = drawContext.context;
21447
+ 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;
21448
+ }
21449
+ return !1;
21450
+ }
21451
+ }, {
21452
+ key: "getShadowRoot",
21453
+ value: function getShadowRoot(interactiveLayer) {
21454
+ var _a;
21455
+ var group = interactiveLayer.getElementById("_interactive_group");
21456
+ return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
21457
+ }
21458
+ }]);
21459
+ return InteractiveDrawItemInterceptorContribution;
21460
+ }();
21461
+ var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
21462
+ function Canvas3DDrawItemInterceptor() {
21463
+ _classCallCheck(this, Canvas3DDrawItemInterceptor);
21464
+ this.order = 1;
21465
+ }
21466
+ _createClass(Canvas3DDrawItemInterceptor, [{
21467
+ key: "beforeDrawItem",
21468
+ value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21469
+ if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
21470
+ drawContext.in3dInterceptor = !0;
21471
+ var _renderService$drawPa = renderService.drawParams,
21472
+ context = _renderService$drawPa.context,
21473
+ stage = _renderService$drawPa.stage;
21474
+ context.canvas;
21475
+ context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
21476
+ var m = context.currentMatrix;
21477
+ m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
21478
+ var matrix = mat4Allocate.allocate();
21479
+ mat3Tomat4(matrix, m);
21480
+ var lastModelMatrix = context.modelMatrix;
21481
+ if (lastModelMatrix) {
21482
+ if (matrix) {
21483
+ var _m = mat4Allocate.allocate();
21484
+ context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
21485
+ }
21486
+ } else context.modelMatrix = matrix;
21487
+ if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
21488
+ var isPie = !1,
21489
+ is3d = !1;
21490
+ if (graphic.forEachChildren(function (c) {
21491
+ return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
21492
+ }), graphic.forEachChildren(function (c) {
21493
+ return is3d = !!c.findFace, !is3d;
21494
+ }), isPie) {
21495
+ var children = graphic.getChildren(),
21496
+ sortedChildren = _toConsumableArray(children);
21497
+ sortedChildren.sort(function (a, b) {
21498
+ var _a, _b, _c, _d;
21499
+ var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
21500
+ angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
21501
+ for (; angle1 < 0;) angle1 += pi2;
21502
+ for (; angle2 < 0;) angle2 += pi2;
21503
+ return angle2 - angle1;
21504
+ }), sortedChildren.forEach(function (c) {
21505
+ c._next = null, c._prev = null;
21506
+ }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
21507
+ graphic.appendChild(c);
21508
+ });
21509
+ var _m2 = graphic.parent.globalTransMatrix;
21510
+ 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) {
21511
+ c._next = null, c._prev = null;
21512
+ }), children.forEach(function (c) {
21513
+ graphic.appendChild(c);
21514
+ });
21515
+ } else if (is3d) {
21516
+ var _children = graphic.getChildren(),
21517
+ zChildren = _children.map(function (g) {
21518
+ return {
21519
+ ave_z: g.findFace().vertices.map(function (v) {
21520
+ var _a;
21521
+ return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
21522
+ }).reduce(function (a, b) {
21523
+ return a + b;
21524
+ }, 0),
21525
+ g: g
21526
+ };
21527
+ });
21528
+ zChildren.sort(function (a, b) {
21529
+ return b.ave_z - a.ave_z;
21530
+ }), graphic.removeAllChild(), zChildren.forEach(function (i) {
21531
+ i.g._next = null, i.g._prev = null;
21532
+ }), graphic.update(), zChildren.forEach(function (i) {
21533
+ graphic.add(i.g);
21534
+ }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
21535
+ g._next = null, g._prev = null;
21536
+ }), graphic.update(), _children.forEach(function (g) {
21537
+ graphic.add(g);
21538
+ });
21539
+ } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
21540
+ } else drawContribution.renderItem(graphic, drawContext);
21541
+ return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
21542
+ }
21543
+ }, {
21544
+ key: "initCanvasCtx",
21545
+ value: function initCanvasCtx(context) {
21546
+ context.setTransformForCurrent();
21547
+ }
21548
+ }]);
21549
+ return Canvas3DDrawItemInterceptor;
21550
+ }();
21551
+
21552
+ var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21553
+ var d,
21554
+ c = arguments.length,
21555
+ r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21556
+ 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);
21557
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
21558
+ },
21559
+ __metadata$_ = undefined && undefined.__metadata || function (k, v) {
21560
+ if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21243
21561
  },
21244
21562
  __param$E = undefined && undefined.__param || function (paramIndex, decorator) {
21245
21563
  return function (target, key) {
@@ -21298,7 +21616,7 @@
21298
21616
  }]);
21299
21617
  return DefaultRenderService;
21300
21618
  }();
21301
- exports.DefaultRenderService = __decorate$1j([injectable(), __param$E(0, inject(DrawContribution)), __metadata$$("design:paramtypes", [Object])], exports.DefaultRenderService);
21619
+ exports.DefaultRenderService = __decorate$1i([injectable(), __param$E(0, inject(DrawContribution)), __metadata$_("design:paramtypes", [Object])], exports.DefaultRenderService);
21302
21620
 
21303
21621
  var renderModule$1 = new ContainerModule(function (bind) {
21304
21622
  bind(RenderService).to(exports.DefaultRenderService).inSingletonScope();
@@ -21309,7 +21627,7 @@
21309
21627
  var BoundsPicker = Symbol["for"]("BoundsPicker");
21310
21628
  var GlobalPickerService = Symbol["for"]("GlobalPickerService");
21311
21629
 
21312
- var __decorate$1i = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21630
+ var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21313
21631
  var d,
21314
21632
  c = arguments.length,
21315
21633
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
@@ -21350,7 +21668,7 @@
21350
21668
  }]);
21351
21669
  return ShadowRootPickItemInterceptorContribution;
21352
21670
  }();
21353
- exports.ShadowRootPickItemInterceptorContribution = __decorate$1i([injectable()], exports.ShadowRootPickItemInterceptorContribution);
21671
+ exports.ShadowRootPickItemInterceptorContribution = __decorate$1h([injectable()], exports.ShadowRootPickItemInterceptorContribution);
21354
21672
  exports.InteractivePickItemInterceptorContribution = /*#__PURE__*/function () {
21355
21673
  function InteractivePickItemInterceptorContribution() {
21356
21674
  _classCallCheck(this, InteractivePickItemInterceptorContribution);
@@ -21374,7 +21692,7 @@
21374
21692
  }]);
21375
21693
  return InteractivePickItemInterceptorContribution;
21376
21694
  }();
21377
- exports.InteractivePickItemInterceptorContribution = __decorate$1i([injectable()], exports.InteractivePickItemInterceptorContribution);
21695
+ exports.InteractivePickItemInterceptorContribution = __decorate$1h([injectable()], exports.InteractivePickItemInterceptorContribution);
21378
21696
  exports.Canvas3DPickItemInterceptor = /*#__PURE__*/function () {
21379
21697
  function Canvas3DPickItemInterceptor() {
21380
21698
  _classCallCheck(this, Canvas3DPickItemInterceptor);
@@ -21451,7 +21769,7 @@
21451
21769
  }]);
21452
21770
  return Canvas3DPickItemInterceptor;
21453
21771
  }();
21454
- exports.Canvas3DPickItemInterceptor = __decorate$1i([injectable()], exports.Canvas3DPickItemInterceptor);
21772
+ exports.Canvas3DPickItemInterceptor = __decorate$1h([injectable()], exports.Canvas3DPickItemInterceptor);
21455
21773
 
21456
21774
  var pickModule = new ContainerModule(function (bind, unbind, isBound) {
21457
21775
  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);
@@ -21464,14 +21782,14 @@
21464
21782
  var AutoEnablePlugins = Symbol["for"]("AutoEnablePlugins");
21465
21783
  var PluginService = Symbol["for"]("PluginService");
21466
21784
 
21467
- var __decorate$1h = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21785
+ var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21468
21786
  var d,
21469
21787
  c = arguments.length,
21470
21788
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21471
21789
  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);
21472
21790
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21473
21791
  },
21474
- __metadata$_ = undefined && undefined.__metadata || function (k, v) {
21792
+ __metadata$Z = undefined && undefined.__metadata || function (k, v) {
21475
21793
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21476
21794
  },
21477
21795
  __param$D = undefined && undefined.__param || function (paramIndex, decorator) {
@@ -21527,7 +21845,7 @@
21527
21845
  }]);
21528
21846
  return DefaultPluginService;
21529
21847
  }();
21530
- DefaultPluginService = __decorate$1h([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$_("design:paramtypes", [Object])], DefaultPluginService);
21848
+ DefaultPluginService = __decorate$1g([injectable(), __param$D(0, inject(ContributionProvider)), __param$D(0, named(AutoEnablePlugins)), __metadata$Z("design:paramtypes", [Object])], DefaultPluginService);
21531
21849
 
21532
21850
  var pluginModule = new ContainerModule(function (bind) {
21533
21851
  bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
@@ -21541,14 +21859,14 @@
21541
21859
  bind(TextMeasureContribution).to(exports.DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
21542
21860
  });
21543
21861
 
21544
- var __decorate$1g = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21862
+ var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21545
21863
  var d,
21546
21864
  c = arguments.length,
21547
21865
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21548
21866
  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);
21549
21867
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21550
21868
  },
21551
- __metadata$Z = undefined && undefined.__metadata || function (k, v) {
21869
+ __metadata$Y = undefined && undefined.__metadata || function (k, v) {
21552
21870
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21553
21871
  };
21554
21872
  var CanvasLayerHandlerContribution = /*#__PURE__*/function () {
@@ -21642,16 +21960,16 @@
21642
21960
  }]);
21643
21961
  return CanvasLayerHandlerContribution;
21644
21962
  }();
21645
- CanvasLayerHandlerContribution = __decorate$1g([injectable(), __metadata$Z("design:paramtypes", [])], CanvasLayerHandlerContribution);
21963
+ CanvasLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], CanvasLayerHandlerContribution);
21646
21964
 
21647
- var __decorate$1f = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21965
+ var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21648
21966
  var d,
21649
21967
  c = arguments.length,
21650
21968
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21651
21969
  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);
21652
21970
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21653
21971
  },
21654
- __metadata$Y = undefined && undefined.__metadata || function (k, v) {
21972
+ __metadata$X = undefined && undefined.__metadata || function (k, v) {
21655
21973
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21656
21974
  };
21657
21975
  var EmptyLayerHandlerContribution = /*#__PURE__*/function () {
@@ -21709,16 +22027,16 @@
21709
22027
  }]);
21710
22028
  return EmptyLayerHandlerContribution;
21711
22029
  }();
21712
- EmptyLayerHandlerContribution = __decorate$1f([injectable(), __metadata$Y("design:paramtypes", [])], EmptyLayerHandlerContribution);
22030
+ EmptyLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], EmptyLayerHandlerContribution);
21713
22031
 
21714
- var __decorate$1e = undefined && undefined.__decorate || function (decorators, target, key, desc) {
22032
+ var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21715
22033
  var d,
21716
22034
  c = arguments.length,
21717
22035
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21718
22036
  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);
21719
22037
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21720
22038
  },
21721
- __metadata$X = undefined && undefined.__metadata || function (k, v) {
22039
+ __metadata$W = undefined && undefined.__metadata || function (k, v) {
21722
22040
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21723
22041
  };
21724
22042
  var OffscreenLayerHandlerContribution = /*#__PURE__*/function () {
@@ -21764,10 +22082,10 @@
21764
22082
  value: function render(group, params) {
21765
22083
  var _a;
21766
22084
  params.renderService.render(group, Object.assign(Object.assign({
21767
- context: this.context
22085
+ context: this.context,
22086
+ viewBox: params.stage.window.getViewBox(),
22087
+ transMatrix: params.stage.window.getViewBoxTransform()
21768
22088
  }, params), {
21769
- x: 0,
21770
- y: 0,
21771
22089
  clear: null !== (_a = params.background) && void 0 !== _a ? _a : "#ffffff"
21772
22090
  }));
21773
22091
  }
@@ -21789,14 +22107,11 @@
21789
22107
  value: function drawTo(target, group, params) {
21790
22108
  var context = target.getContext(),
21791
22109
  targetDpr = target.dpr,
21792
- _params$x = params.x,
21793
- x = _params$x === void 0 ? 0 : _params$x,
21794
- _params$y = params.y,
21795
- y = _params$y === void 0 ? 0 : _params$y,
21796
- _params$width = params.width,
21797
- width = _params$width === void 0 ? this.layer.viewWidth : _params$width,
21798
- _params$height = params.height,
21799
- height = _params$height === void 0 ? this.layer.viewHeight : _params$height;
22110
+ viewBox = params.viewBox,
22111
+ x = viewBox.x1,
22112
+ y = viewBox.y1,
22113
+ width = viewBox.width(),
22114
+ height = viewBox.height();
21800
22115
  context.nativeContext.save(), context.nativeContext.setTransform(targetDpr, 0, 0, targetDpr, 0, 0), params.clear && context.clearRect(x, y, width, height), context.drawImage(this.canvas.nativeCanvas, 0, 0, this.canvas.width, this.canvas.height, x, y, width, height), context.nativeContext.restore();
21801
22116
  }
21802
22117
  }, {
@@ -21805,7 +22120,7 @@
21805
22120
  }]);
21806
22121
  return OffscreenLayerHandlerContribution;
21807
22122
  }();
21808
- OffscreenLayerHandlerContribution = __decorate$1e([injectable(), __metadata$X("design:paramtypes", [])], OffscreenLayerHandlerContribution);
22123
+ OffscreenLayerHandlerContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], OffscreenLayerHandlerContribution);
21809
22124
 
21810
22125
  var layerHandlerModules = new ContainerModule(function (bind) {
21811
22126
  bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
@@ -21932,241 +22247,6 @@
21932
22247
  return result;
21933
22248
  }
21934
22249
 
21935
- var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21936
- var d,
21937
- c = arguments.length,
21938
- r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21939
- 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);
21940
- return c > 3 && r && Object.defineProperty(target, key, r), r;
21941
- },
21942
- __metadata$W = undefined && undefined.__metadata || function (k, v) {
21943
- if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21944
- };
21945
- var DrawItemInterceptor = Symbol["for"]("DrawItemInterceptor");
21946
- var tempDirtyBounds = new AABBBounds();
21947
- var ShadowRootDrawItemInterceptorContribution = /*#__PURE__*/function () {
21948
- function ShadowRootDrawItemInterceptorContribution() {
21949
- _classCallCheck(this, ShadowRootDrawItemInterceptorContribution);
21950
- this.order = 1;
21951
- }
21952
- _createClass(ShadowRootDrawItemInterceptorContribution, [{
21953
- key: "afterDrawItem",
21954
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21955
- return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21956
- }
21957
- }, {
21958
- key: "beforeDrawItem",
21959
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21960
- return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21961
- }
21962
- }, {
21963
- key: "drawItem",
21964
- value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21965
- if (!graphic.shadowRoot) return !1;
21966
- var context = drawContext.context;
21967
- if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
21968
- tempDirtyBounds.copy(drawContribution.dirtyBounds);
21969
- var m = graphic.globalTransMatrix.getInverse();
21970
- drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
21971
- }
21972
- return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
21973
- }
21974
- }]);
21975
- return ShadowRootDrawItemInterceptorContribution;
21976
- }();
21977
- var DebugDrawItemInterceptorContribution = /*#__PURE__*/function () {
21978
- function DebugDrawItemInterceptorContribution() {
21979
- _classCallCheck(this, DebugDrawItemInterceptorContribution);
21980
- this.order = 1;
21981
- }
21982
- _createClass(DebugDrawItemInterceptorContribution, [{
21983
- key: "afterDrawItem",
21984
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21985
- return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21986
- }
21987
- }, {
21988
- key: "drawItem",
21989
- value: function drawItem(graphic, renderService, drawContext, drawContribution, params) {
21990
- if (!graphic.attribute._debug_bounds) return !1;
21991
- var context = drawContext.context;
21992
- context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
21993
- var b = graphic.AABBBounds;
21994
- 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;
21995
- }
21996
- }]);
21997
- return DebugDrawItemInterceptorContribution;
21998
- }();
21999
- var CommonDrawItemInterceptorContribution = /*#__PURE__*/function () {
22000
- function CommonDrawItemInterceptorContribution() {
22001
- _classCallCheck(this, CommonDrawItemInterceptorContribution);
22002
- this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
22003
- }
22004
- _createClass(CommonDrawItemInterceptorContribution, [{
22005
- key: "afterDrawItem",
22006
- value: function afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
22007
- 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;
22008
- return !1;
22009
- }
22010
- }, {
22011
- key: "beforeDrawItem",
22012
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
22013
- if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
22014
- 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;
22015
- return !1;
22016
- }
22017
- }]);
22018
- return CommonDrawItemInterceptorContribution;
22019
- }();
22020
- CommonDrawItemInterceptorContribution = __decorate$1d([injectable(), __metadata$W("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
22021
- var InteractiveDrawItemInterceptorContribution = /*#__PURE__*/function () {
22022
- function InteractiveDrawItemInterceptorContribution() {
22023
- _classCallCheck(this, InteractiveDrawItemInterceptorContribution);
22024
- this.order = 1;
22025
- }
22026
- _createClass(InteractiveDrawItemInterceptorContribution, [{
22027
- key: "beforeDrawItem",
22028
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
22029
- return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
22030
- }
22031
- }, {
22032
- key: "beforeSetInteractive",
22033
- value: function beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
22034
- var interactiveGraphic = graphic.interactiveGraphic;
22035
- if (graphic.attribute.globalZIndex) {
22036
- interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
22037
- globalZIndex: 0,
22038
- zIndex: graphic.attribute.globalZIndex
22039
- }, !1, {
22040
- skipUpdateCallback: !0
22041
- }), drawContext.stage.tryInitInteractiveLayer();
22042
- var interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
22043
- if (interactiveLayer) {
22044
- this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
22045
- }
22046
- return !0;
22047
- }
22048
- if (interactiveGraphic) {
22049
- drawContext.stage.tryInitInteractiveLayer();
22050
- var _interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
22051
- if (_interactiveLayer) {
22052
- this.getShadowRoot(_interactiveLayer).removeChild(interactiveGraphic);
22053
- }
22054
- graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
22055
- }
22056
- return !1;
22057
- }
22058
- }, {
22059
- key: "beforeDrawInteractive",
22060
- value: function beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
22061
- var baseGraphic = graphic.baseGraphic;
22062
- if (baseGraphic) {
22063
- this.processing = !0;
22064
- var context = drawContext.context;
22065
- 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;
22066
- }
22067
- return !1;
22068
- }
22069
- }, {
22070
- key: "getShadowRoot",
22071
- value: function getShadowRoot(interactiveLayer) {
22072
- var _a;
22073
- var group = interactiveLayer.getElementById("_interactive_group");
22074
- return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
22075
- }
22076
- }]);
22077
- return InteractiveDrawItemInterceptorContribution;
22078
- }();
22079
- var Canvas3DDrawItemInterceptor = /*#__PURE__*/function () {
22080
- function Canvas3DDrawItemInterceptor() {
22081
- _classCallCheck(this, Canvas3DDrawItemInterceptor);
22082
- this.order = 1;
22083
- }
22084
- _createClass(Canvas3DDrawItemInterceptor, [{
22085
- key: "beforeDrawItem",
22086
- value: function beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
22087
- if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
22088
- drawContext.in3dInterceptor = !0;
22089
- var _renderService$drawPa = renderService.drawParams,
22090
- context = _renderService$drawPa.context,
22091
- stage = _renderService$drawPa.stage;
22092
- context.canvas;
22093
- context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
22094
- var m = context.currentMatrix;
22095
- m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
22096
- var matrix = mat4Allocate.allocate();
22097
- mat3Tomat4(matrix, m);
22098
- var lastModelMatrix = context.modelMatrix;
22099
- if (lastModelMatrix) {
22100
- if (matrix) {
22101
- var _m = mat4Allocate.allocate();
22102
- context.modelMatrix = multiplyMat4Mat4(_m, lastModelMatrix, matrix);
22103
- }
22104
- } else context.modelMatrix = matrix;
22105
- if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
22106
- var isPie = !1,
22107
- is3d = !1;
22108
- if (graphic.forEachChildren(function (c) {
22109
- return isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie;
22110
- }), graphic.forEachChildren(function (c) {
22111
- return is3d = !!c.findFace, !is3d;
22112
- }), isPie) {
22113
- var children = graphic.getChildren(),
22114
- sortedChildren = _toConsumableArray(children);
22115
- sortedChildren.sort(function (a, b) {
22116
- var _a, _b, _c, _d;
22117
- var angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
22118
- angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
22119
- for (; angle1 < 0;) angle1 += pi2;
22120
- for (; angle2 < 0;) angle2 += pi2;
22121
- return angle2 - angle1;
22122
- }), sortedChildren.forEach(function (c) {
22123
- c._next = null, c._prev = null;
22124
- }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(function (c) {
22125
- graphic.appendChild(c);
22126
- });
22127
- var _m2 = graphic.parent.globalTransMatrix;
22128
- 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) {
22129
- c._next = null, c._prev = null;
22130
- }), children.forEach(function (c) {
22131
- graphic.appendChild(c);
22132
- });
22133
- } else if (is3d) {
22134
- var _children = graphic.getChildren(),
22135
- zChildren = _children.map(function (g) {
22136
- return {
22137
- ave_z: g.findFace().vertices.map(function (v) {
22138
- var _a;
22139
- return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
22140
- }).reduce(function (a, b) {
22141
- return a + b;
22142
- }, 0),
22143
- g: g
22144
- };
22145
- });
22146
- zChildren.sort(function (a, b) {
22147
- return b.ave_z - a.ave_z;
22148
- }), graphic.removeAllChild(), zChildren.forEach(function (i) {
22149
- i.g._next = null, i.g._prev = null;
22150
- }), graphic.update(), zChildren.forEach(function (i) {
22151
- graphic.add(i.g);
22152
- }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), _children.forEach(function (g) {
22153
- g._next = null, g._prev = null;
22154
- }), graphic.update(), _children.forEach(function (g) {
22155
- graphic.add(g);
22156
- });
22157
- } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
22158
- } else drawContribution.renderItem(graphic, drawContext);
22159
- return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
22160
- }
22161
- }, {
22162
- key: "initCanvasCtx",
22163
- value: function initCanvasCtx(context) {
22164
- context.setTransformForCurrent();
22165
- }
22166
- }]);
22167
- return Canvas3DDrawItemInterceptor;
22168
- }();
22169
-
22170
22250
  var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
22171
22251
  var d,
22172
22252
  c = arguments.length,
@@ -22212,27 +22292,21 @@
22212
22292
  this.prepareForDraw(renderService, drawContext), drawContext.drawContribution = this, this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap, this.currentRenderService = renderService;
22213
22293
  var context = drawContext.context,
22214
22294
  stage = drawContext.stage,
22215
- _drawContext$x = drawContext.x,
22216
- x = _drawContext$x === void 0 ? 0 : _drawContext$x,
22217
- _drawContext$y = drawContext.y,
22218
- y = _drawContext$y === void 0 ? 0 : _drawContext$y,
22219
- width = drawContext.width,
22220
- height = drawContext.height;
22295
+ viewBox = drawContext.viewBox,
22296
+ transMatrix = drawContext.transMatrix;
22221
22297
  if (!context) return;
22222
- var dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
22298
+ var dirtyBounds = this.dirtyBounds.setValue(0, 0, viewBox.width(), viewBox.height());
22223
22299
  if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
22224
22300
  var b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
22225
22301
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
22226
22302
  }
22227
22303
  var d = context.dpr % 1;
22228
- (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);
22229
- var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
22230
- 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) {
22304
+ (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.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(), context.setTransformForCurrent(!0), context.translate(viewBox.x1, viewBox.y1, !0), 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) {
22231
22305
  var _a, _b;
22232
22306
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22233
22307
  }).forEach(function (group) {
22234
22308
  group.isContainer ? _this2.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : _this2.renderItem(group, drawContext);
22235
- }), context.restore(), context.restore(), context.draw(), context.inuse = !1;
22309
+ }), context.restore(), context.draw(), context.setClearMatrix(1, 0, 0, 1, 0, 0), context.inuse = !1;
22236
22310
  }
22237
22311
  }, {
22238
22312
  key: "doRegister",
@@ -22320,7 +22394,7 @@
22320
22394
  key: "getRenderContribution",
22321
22395
  value: function getRenderContribution(graphic) {
22322
22396
  var renderer;
22323
- return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
22397
+ return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType, graphic)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
22324
22398
  }
22325
22399
  }, {
22326
22400
  key: "renderItem",
@@ -22359,35 +22433,36 @@
22359
22433
  }
22360
22434
  }, {
22361
22435
  key: "selectRenderByNumberType",
22362
- value: function selectRenderByNumberType(type) {
22363
- return this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
22436
+ value: function selectRenderByNumberType(type, graphic) {
22437
+ var data;
22438
+ if (graphic.attribute.renderStyle) {
22439
+ var currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);
22440
+ data = currentRenderMap && currentRenderMap.get(type);
22441
+ }
22442
+ return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
22364
22443
  }
22365
22444
  }, {
22366
22445
  key: "clearScreen",
22367
22446
  value: function clearScreen(renderService, context, drawContext) {
22368
22447
  var _a, _b;
22369
- var clear = drawContext.clear;
22448
+ var clear = drawContext.clear,
22449
+ viewBox = drawContext.viewBox,
22450
+ width = viewBox.width(),
22451
+ height = viewBox.height();
22370
22452
  if (clear) {
22371
- var canvas = context.getCanvas(),
22372
- _drawContext$width = drawContext.width,
22373
- width = _drawContext$width === void 0 ? canvas.width : _drawContext$width,
22374
- _drawContext$height = drawContext.height,
22375
- height = _drawContext$height === void 0 ? canvas.height : _drawContext$height,
22376
- x = 0,
22377
- y = 0;
22378
- context.clearRect(x, y, width, height);
22453
+ context.clearRect(0, 0, width, height);
22379
22454
  var stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
22380
22455
  if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
22381
22456
  var res = stage.resources.get(clear);
22382
- res && "success" === res.state && res.data && context.drawImage(res.data, x, y, width, height);
22457
+ res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
22383
22458
  } else context.fillStyle = createColor(context, clear, {
22384
22459
  AABBBounds: {
22385
- x1: x,
22386
- y1: y,
22387
- x2: x + width,
22388
- y2: y + height
22460
+ x1: 0,
22461
+ y1: 0,
22462
+ x2: 0 + width,
22463
+ y2: 0 + height
22389
22464
  }
22390
- }, 0, 0), context.fillRect(x, y, width, height);
22465
+ }, 0, 0), context.fillRect(0, 0, width, height);
22391
22466
  }
22392
22467
  }
22393
22468
  }, {
@@ -22695,7 +22770,7 @@
22695
22770
  value: function draw(renderService, drawContext) {
22696
22771
  return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
22697
22772
  var _this2 = this;
22698
- var skipDraw, context, _drawContext$x, x, _drawContext$y, y;
22773
+ var skipDraw, context, viewBox;
22699
22774
  return _regeneratorRuntime().wrap(function _callee$(_context) {
22700
22775
  while (1) switch (_context.prev = _context.next) {
22701
22776
  case 0:
@@ -22717,8 +22792,8 @@
22717
22792
  return _context.abrupt("return");
22718
22793
  case 8:
22719
22794
  this.currentRenderService = renderService;
22720
- context = drawContext.context, _drawContext$x = drawContext.x, x = _drawContext$x === void 0 ? 0 : _drawContext$x, _drawContext$y = drawContext.y, y = _drawContext$y === void 0 ? 0 : _drawContext$y;
22721
- context && (context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(x, y, !0), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22795
+ context = drawContext.context, viewBox = drawContext.viewBox;
22796
+ context && (context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(viewBox.x1, viewBox.y1, !0), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
22722
22797
  var _a, _b;
22723
22798
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22724
22799
  }).forEach(function (group) {
@@ -23000,7 +23075,7 @@
23000
23075
  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);
23001
23076
 
23002
23077
  var renderModule = new ContainerModule(function (bind) {
23003
- 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);
23078
+ 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);
23004
23079
  });
23005
23080
 
23006
23081
  function load(container) {
@@ -23131,12 +23206,10 @@
23131
23206
  if (!layer || !group.layer.subLayers) return;
23132
23207
  var subLayer = group.layer.subLayers.get(group._uid);
23133
23208
  subLayer && subLayer.drawContribution && subLayer.drawContribution.draw(stage.renderService, Object.assign({
23134
- x: stage.x,
23135
- y: stage.y,
23136
- width: layer.viewWidth,
23137
- height: layer.viewHeight,
23138
23209
  stage: stage,
23139
23210
  layer: layer,
23211
+ viewBox: stage.window.getViewBox(),
23212
+ transMatrix: stage.window.getViewBoxTransform(),
23140
23213
  clear: "transparent",
23141
23214
  renderService: stage.renderService,
23142
23215
  updateBounds: !1,
@@ -23160,6 +23233,8 @@
23160
23233
  var _this = this;
23161
23234
  this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, function (stage) {
23162
23235
  stage && stage === _this.pluginService.stage && _this.drawHTML(context.stage.renderService);
23236
+ }), application.graphicService.hooks.onRemove.tap(this.key, function (graphic) {
23237
+ _this.removeDom(graphic);
23163
23238
  }), application.graphicService.hooks.onRelease.tap(this.key, function (graphic) {
23164
23239
  _this.removeDom(graphic);
23165
23240
  });
@@ -23216,26 +23291,27 @@
23216
23291
  anchorType = _html$anchorType === void 0 ? "boundsLeftTop" : _html$anchorType;
23217
23292
  graphic.bindDom || (graphic.bindDom = new Map());
23218
23293
  var lastDom = graphic.bindDom.get(dom);
23219
- if (lastDom && (!container || container === lastDom.container)) return;
23220
- var nativeDom, nativeContainer;
23221
- graphic.bindDom.forEach(function (_ref) {
23222
- var wrapGroup = _ref.wrapGroup;
23223
- application.global.removeDom(wrapGroup);
23224
- }), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
23225
- var _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
23226
- nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer();
23227
- var wrapGroup = application.global.createDom({
23228
- tagName: "div",
23229
- width: width,
23230
- height: height,
23231
- style: style,
23232
- parent: nativeContainer
23233
- });
23234
- wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
23235
- dom: nativeDom,
23236
- container: container,
23237
- wrapGroup: wrapGroup
23238
- })), wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
23294
+ var wrapGroup, nativeContainer;
23295
+ if (!lastDom || container && container !== lastDom.container) {
23296
+ var nativeDom;
23297
+ graphic.bindDom.forEach(function (_ref) {
23298
+ var wrapGroup = _ref.wrapGroup;
23299
+ application.global.removeDom(wrapGroup);
23300
+ }), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
23301
+ var _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
23302
+ nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer(), wrapGroup = application.global.createDom({
23303
+ tagName: "div",
23304
+ width: width,
23305
+ height: height,
23306
+ style: style,
23307
+ parent: nativeContainer
23308
+ }), wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
23309
+ dom: nativeDom,
23310
+ container: container,
23311
+ wrapGroup: wrapGroup
23312
+ }));
23313
+ } else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
23314
+ wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
23239
23315
  var left = 0,
23240
23316
  top = 0;
23241
23317
  var b = graphic.globalAABBBounds;
@@ -23299,13 +23375,23 @@
23299
23375
  this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
23300
23376
  }
23301
23377
  _createClass(FlexLayoutPlugin, [{
23378
+ key: "pauseLayout",
23379
+ value: function pauseLayout(p) {
23380
+ this.pause = p;
23381
+ }
23382
+ }, {
23383
+ key: "tryLayoutChildren",
23384
+ value: function tryLayoutChildren(graphic) {
23385
+ graphic.firstChild && this.tryLayout(graphic.firstChild);
23386
+ }
23387
+ }, {
23302
23388
  key: "tryLayout",
23303
23389
  value: function tryLayout(graphic) {
23304
23390
  var _this = this;
23305
- if (this.layouting) return;
23306
- this.layouting = !0;
23391
+ var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
23392
+ if (this.pause) return;
23307
23393
  var p = graphic.parent;
23308
- if (!p || !graphic.needUpdateLayout()) return;
23394
+ if (!(force || p && graphic.needUpdateLayout())) return;
23309
23395
  var theme = getTheme(p).group,
23310
23396
  _p$attribute$display = p.attribute.display,
23311
23397
  display = _p$attribute$display === void 0 ? theme.display : _p$attribute$display;
@@ -23315,24 +23401,29 @@
23315
23401
  flexDirection = _p$attribute$flexDire === void 0 ? theme.flexDirection : _p$attribute$flexDire,
23316
23402
  _p$attribute$flexWrap = _p$attribute.flexWrap,
23317
23403
  flexWrap = _p$attribute$flexWrap === void 0 ? theme.flexWrap : _p$attribute$flexWrap,
23318
- _p$attribute$justifyC = _p$attribute.justifyContent,
23319
- justifyContent = _p$attribute$justifyC === void 0 ? theme.justifyContent : _p$attribute$justifyC,
23320
23404
  _p$attribute$alignIte = _p$attribute.alignItems,
23321
23405
  alignItems = _p$attribute$alignIte === void 0 ? theme.alignItems : _p$attribute$alignIte,
23322
- _p$attribute$alignCon = _p$attribute.alignContent,
23323
- alignContent = _p$attribute$alignCon === void 0 ? theme.alignContent : _p$attribute$alignCon,
23324
23406
  _p$attribute$clip = _p$attribute.clip,
23325
- clip = _p$attribute$clip === void 0 ? theme.clip : _p$attribute$clip;
23326
- var childrenWidth = 0,
23327
- childrenHeight = 0,
23328
- boundsLegal = 0;
23329
- if (p.forEachChildren(function (child) {
23330
- var bounds = child.AABBBounds;
23331
- "column" === flexDirection || "column-reverse" === flexDirection ? (childrenHeight += bounds.height(), childrenWidth = Math.max(childrenWidth, bounds.width())) : (childrenWidth += bounds.width(), childrenHeight = Math.max(childrenHeight, bounds.height())), boundsLegal += bounds.x1, boundsLegal += bounds.y1, boundsLegal += bounds.x2, boundsLegal += bounds.y2;
23332
- }), !isFinite(boundsLegal)) return;
23333
- var width = p.attribute.width || childrenWidth,
23334
- height = p.attribute.height || childrenHeight;
23335
- p.attribute.width || (p.attribute.width = 0), p.attribute.height || (p.attribute.height = 0), this.tempBounds.copy(p._AABBBounds);
23407
+ clip = _p$attribute$clip === void 0 ? theme.clip : _p$attribute$clip,
23408
+ _p$attribute$alignCon = p.attribute.alignContent,
23409
+ alignContent = _p$attribute$alignCon === void 0 ? null != alignItems ? alignItems : theme.alignContent : _p$attribute$alignCon;
23410
+ var _p$attribute2 = p.attribute,
23411
+ width = _p$attribute2.width,
23412
+ height = _p$attribute2.height,
23413
+ _p$attribute2$justify = _p$attribute2.justifyContent,
23414
+ justifyContent = _p$attribute2$justify === void 0 ? theme.justifyContent : _p$attribute2$justify;
23415
+ var children = p.getChildren();
23416
+ if (null == width || null == height) {
23417
+ var childrenWidth = 0,
23418
+ childrenHeight = 0,
23419
+ boundsLegal = 0;
23420
+ if (children.forEach(function (child) {
23421
+ var bounds = _this.getAABBBounds(child);
23422
+ bounds.empty() || ("column" === flexDirection || "column-reverse" === flexDirection ? (childrenHeight += bounds.height(), childrenWidth = Math.max(childrenWidth, bounds.width())) : (childrenWidth += bounds.width(), childrenHeight = Math.max(childrenHeight, bounds.height())), boundsLegal += bounds.x1, boundsLegal += bounds.y1, boundsLegal += bounds.x2, boundsLegal += bounds.y2);
23423
+ }), !isFinite(boundsLegal)) return;
23424
+ width = childrenWidth, height = childrenHeight;
23425
+ }
23426
+ p.attribute.width = width, p.attribute.height = height, this.tempBounds.copy(p._AABBBounds);
23336
23427
  var result = {
23337
23428
  main: {
23338
23429
  len: width,
@@ -23341,18 +23432,18 @@
23341
23432
  cross: {
23342
23433
  len: height,
23343
23434
  field: "y"
23344
- },
23345
- dir: 1
23435
+ }
23346
23436
  },
23347
23437
  main = result.main,
23348
23438
  cross = result.cross;
23349
- "row-reverse" === flexDirection ? result.dir = -1 : "column" === flexDirection ? (main.len = height, cross.len = width, main.field = "y", cross.field = "x") : "column-reverse" === flexDirection && (main.len = height, cross.len = width, main.field = "y", cross.field = "x", result.dir = -1);
23439
+ "column" !== flexDirection && "column-reverse" !== flexDirection || (main.len = height, cross.len = width, main.field = "y", cross.field = "x"), "row-reverse" !== flexDirection && "column-reverse" !== flexDirection || ("flex-start" === justifyContent ? justifyContent = "flex-end" : "flex-end" === justifyContent ? justifyContent = "flex-start" : children.reverse());
23350
23440
  var mainLen = 0,
23351
23441
  crossLen = 0;
23352
23442
  var mianLenArray = [];
23353
- p.forEachChildren(function (c) {
23354
- var b = c.AABBBounds,
23355
- ml = "x" === main.field ? b.width() : b.height(),
23443
+ children.forEach(function (c) {
23444
+ var b = _this.getAABBBounds(c);
23445
+ if (b.empty()) return;
23446
+ var ml = "x" === main.field ? b.width() : b.height(),
23356
23447
  cl = "x" === cross.field ? b.width() : b.height();
23357
23448
  mianLenArray.push({
23358
23449
  mainLen: ml,
@@ -23385,104 +23476,171 @@
23385
23476
  mainLen: mainLen,
23386
23477
  crossLen: crossLen
23387
23478
  });
23388
- var children = p.getChildren();
23389
23479
  var lastIdx = 0;
23390
23480
  if (mainList.forEach(function (s) {
23391
23481
  _this.layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, s), lastIdx = s.idx + 1;
23392
23482
  }), crossLen = mainList.reduce(function (a, b) {
23393
23483
  return a + b.crossLen;
23394
23484
  }, 0), 1 === mainList.length) {
23395
- if ("flex-end" === alignItems) {
23396
- var anchorPos = cross.len;
23397
- this.layoutCross(children, alignItems, cross, anchorPos, mianLenArray, mainList[0], 0);
23398
- } else if ("center" === alignItems) {
23399
- var _anchorPos = cross.len / 2;
23400
- this.layoutCross(children, alignItems, cross, _anchorPos, mianLenArray, mainList[0], 0);
23401
- } else children.forEach(function (child) {
23402
- child.attribute[cross.field] = getPadding(child, cross.field);
23403
- });
23485
+ var anchorPosMap = {
23486
+ "flex-start": 0,
23487
+ "flex-end": cross.len,
23488
+ center: cross.len / 2
23489
+ };
23490
+ this.layoutCross(children, alignItems, cross, anchorPosMap, mianLenArray, mainList[0], 0);
23404
23491
  } else if ("flex-start" === alignContent) {
23405
23492
  lastIdx = 0;
23406
- var _anchorPos2 = 0;
23493
+ var anchorPos = 0;
23407
23494
  mainList.forEach(function (s, i) {
23408
- _this.layoutCross(children, "flex-start", cross, _anchorPos2, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos2 += s.crossLen;
23495
+ var anchorPosMap = {
23496
+ "flex-start": anchorPos,
23497
+ "flex-end": anchorPos + s.crossLen,
23498
+ center: anchorPos + s.crossLen / 2
23499
+ };
23500
+ _this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
23409
23501
  });
23410
23502
  } else if ("center" === alignContent) {
23411
23503
  lastIdx = 0;
23412
- var _anchorPos3 = Math.max(0, (cross.len - crossLen) / 2);
23504
+ var _anchorPos = Math.max(0, (cross.len - crossLen) / 2);
23413
23505
  mainList.forEach(function (s, i) {
23414
- _this.layoutCross(children, "center", cross, _anchorPos3 + s.crossLen / 2, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos3 += s.crossLen;
23506
+ var anchorPosMap = {
23507
+ "flex-start": _anchorPos,
23508
+ "flex-end": _anchorPos + s.crossLen,
23509
+ center: _anchorPos + s.crossLen / 2
23510
+ };
23511
+ _this.layoutCross(children, "center", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos += s.crossLen;
23415
23512
  });
23416
23513
  } else if ("space-around" === alignContent) {
23417
23514
  lastIdx = 0;
23418
23515
  var padding = Math.max(0, (cross.len - crossLen) / mainList.length / 2);
23419
- var _anchorPos4 = padding;
23516
+ var _anchorPos2 = padding;
23420
23517
  mainList.forEach(function (s, i) {
23421
- _this.layoutCross(children, "flex-start", cross, _anchorPos4, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos4 += s.crossLen + 2 * padding;
23518
+ var anchorPosMap = {
23519
+ "flex-start": _anchorPos2,
23520
+ "flex-end": _anchorPos2 + s.crossLen,
23521
+ center: _anchorPos2 + s.crossLen / 2
23522
+ };
23523
+ _this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos2 += s.crossLen + 2 * padding;
23422
23524
  });
23423
23525
  } else if ("space-between" === alignContent) {
23424
23526
  lastIdx = 0;
23425
23527
  var _padding = Math.max(0, (cross.len - crossLen) / (2 * mainList.length - 2));
23426
- var _anchorPos5 = 0;
23528
+ var _anchorPos3 = 0;
23427
23529
  mainList.forEach(function (s, i) {
23428
- _this.layoutCross(children, "flex-start", cross, _anchorPos5, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos5 += s.crossLen + 2 * _padding;
23530
+ var anchorPosMap = {
23531
+ "flex-start": _anchorPos3,
23532
+ "flex-end": _anchorPos3 + s.crossLen,
23533
+ center: _anchorPos3 + s.crossLen / 2
23534
+ };
23535
+ _this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, _anchorPos3 += s.crossLen + 2 * _padding;
23429
23536
  });
23430
23537
  }
23431
23538
  children.forEach(function (child, idx) {
23432
23539
  child.addUpdateBoundTag(), child.addUpdatePositionTag(), child.clearUpdateLayoutTag();
23433
- }), p.addUpdateLayoutTag(), clip || this.tempBounds.equals(p.AABBBounds) || (this.tryLayout(p), this.layouting = !1);
23540
+ }), p.addUpdateLayoutTag();
23541
+ var b = this.getAABBBounds(p);
23542
+ clip || this.tempBounds.equals(b) || this.tryLayout(p, !1);
23543
+ }
23544
+ }, {
23545
+ key: "getAABBBounds",
23546
+ value: function getAABBBounds(graphic) {
23547
+ this.skipBoundsTrigger = !0;
23548
+ var b = graphic.AABBBounds;
23549
+ return this.skipBoundsTrigger = !1, b;
23550
+ }
23551
+ }, {
23552
+ key: "updateChildPos",
23553
+ value: function updateChildPos(posBaseLeftTop, lastP, lastBP) {
23554
+ return posBaseLeftTop + (null != lastP ? lastP : 0) - lastBP;
23434
23555
  }
23435
23556
  }, {
23436
23557
  key: "layoutMain",
23437
23558
  value: function layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, currSeg) {
23438
23559
  if ("flex-start" === justifyContent) {
23439
23560
  var pos = 0;
23440
- for (var i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[main.field] = pos + getPadding(children[i], main.field), pos += mianLenArray[i].mainLen;
23561
+ for (var i = lastIdx; i <= currSeg.idx; i++) {
23562
+ var posBaseLeftTop = pos + getPadding(children[i], main.field),
23563
+ b = this.getAABBBounds(children[i]);
23564
+ !b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b["".concat(main.field, "1")])), pos += mianLenArray[i].mainLen;
23565
+ }
23441
23566
  } else if ("flex-end" === justifyContent) {
23442
23567
  var _pos = main.len;
23443
- for (var _i = lastIdx; _i <= currSeg.idx; _i++) _pos -= mianLenArray[_i].mainLen, children[_i].attribute[main.field] = _pos + getPadding(children[_i], main.field);
23568
+ for (var _i = lastIdx; _i <= currSeg.idx; _i++) {
23569
+ _pos -= mianLenArray[_i].mainLen;
23570
+ var _posBaseLeftTop = _pos + getPadding(children[_i], main.field),
23571
+ _b = this.getAABBBounds(children[_i]);
23572
+ !_b.empty() && (children[_i].attribute[main.field] = this.updateChildPos(_posBaseLeftTop, children[_i].attribute[main.field], _b["".concat(main.field, "1")]));
23573
+ }
23444
23574
  } else if ("space-around" === justifyContent) {
23445
23575
  if (currSeg.mainLen >= main.len) {
23446
23576
  var _pos2 = 0;
23447
- for (var _i2 = lastIdx; _i2 <= currSeg.idx; _i2++) children[_i2].attribute[main.field] = _pos2 + getPadding(children[_i2], main.field), _pos2 += mianLenArray[_i2].mainLen;
23577
+ for (var _i2 = lastIdx; _i2 <= currSeg.idx; _i2++) {
23578
+ var _posBaseLeftTop2 = _pos2 + getPadding(children[_i2], main.field),
23579
+ _b2 = this.getAABBBounds(children[_i2]);
23580
+ !_b2.empty() && (children[_i2].attribute[main.field] = this.updateChildPos(_posBaseLeftTop2, children[_i2].attribute[main.field], _b2["".concat(main.field, "1")])), _pos2 += mianLenArray[_i2].mainLen;
23581
+ }
23448
23582
  } else {
23449
23583
  var size = currSeg.idx - lastIdx + 1,
23450
23584
  padding = (main.len - currSeg.mainLen) / size / 2;
23451
23585
  var _pos3 = padding;
23452
- for (var _i3 = lastIdx; _i3 <= currSeg.idx; _i3++) children[_i3].attribute[main.field] = _pos3 + getPadding(children[_i3], main.field), _pos3 += mianLenArray[_i3].mainLen + 2 * padding;
23586
+ for (var _i3 = lastIdx; _i3 <= currSeg.idx; _i3++) {
23587
+ var _posBaseLeftTop3 = _pos3 + getPadding(children[_i3], main.field),
23588
+ _b3 = this.getAABBBounds(children[_i3]);
23589
+ !_b3.empty() && (children[_i3].attribute[main.field] = this.updateChildPos(_posBaseLeftTop3, children[_i3].attribute[main.field], _b3["".concat(main.field, "1")])), _pos3 += mianLenArray[_i3].mainLen + 2 * padding;
23590
+ }
23453
23591
  }
23454
23592
  } else if ("space-between" === justifyContent) {
23455
23593
  if (currSeg.mainLen >= main.len) {
23456
23594
  var _pos4 = 0;
23457
- for (var _i4 = lastIdx; _i4 <= currSeg.idx; _i4++) children[_i4].attribute[main.field] = _pos4 + getPadding(children[_i4], main.field), _pos4 += mianLenArray[_i4].mainLen;
23595
+ for (var _i4 = lastIdx; _i4 <= currSeg.idx; _i4++) {
23596
+ var _posBaseLeftTop4 = _pos4 + getPadding(children[_i4], main.field),
23597
+ _b4 = this.getAABBBounds(children[_i4]);
23598
+ !_b4.empty() && (children[_i4].attribute[main.field] = this.updateChildPos(_posBaseLeftTop4, children[_i4].attribute[main.field], _b4["".concat(main.field, "1")])), _pos4 += mianLenArray[_i4].mainLen;
23599
+ }
23458
23600
  } else {
23459
23601
  var _size = currSeg.idx - lastIdx + 1,
23460
23602
  _padding2 = (main.len - currSeg.mainLen) / (2 * _size - 2);
23461
23603
  var _pos5 = 0;
23462
- for (var _i5 = lastIdx; _i5 <= currSeg.idx; _i5++) children[_i5].attribute[main.field] = _pos5 + getPadding(children[_i5], main.field), _pos5 += mianLenArray[_i5].mainLen + 2 * _padding2;
23604
+ for (var _i5 = lastIdx; _i5 <= currSeg.idx; _i5++) {
23605
+ var _posBaseLeftTop5 = _pos5 + getPadding(children[_i5], main.field),
23606
+ _b5 = this.getAABBBounds(children[_i5]);
23607
+ !_b5.empty() && (children[_i5].attribute[main.field] = this.updateChildPos(_posBaseLeftTop5, children[_i5].attribute[main.field], _b5["".concat(main.field, "1")])), _pos5 += mianLenArray[_i5].mainLen + 2 * _padding2;
23608
+ }
23463
23609
  }
23464
23610
  } else if ("center" === justifyContent) {
23465
23611
  var _pos6 = (main.len - currSeg.mainLen) / 2;
23466
- for (var _i6 = lastIdx; _i6 <= currSeg.idx; _i6++) children[_i6].attribute[main.field] = _pos6 + getPadding(children[_i6], main.field), _pos6 += mianLenArray[_i6].mainLen;
23612
+ for (var _i6 = lastIdx; _i6 <= currSeg.idx; _i6++) {
23613
+ var _posBaseLeftTop6 = _pos6 + getPadding(children[_i6], main.field),
23614
+ _b6 = this.getAABBBounds(children[_i6]);
23615
+ !_b6.empty() && (children[_i6].attribute[main.field] = this.updateChildPos(_posBaseLeftTop6, children[_i6].attribute[main.field], _b6["".concat(main.field, "1")])), _pos6 += mianLenArray[_i6].mainLen;
23616
+ }
23467
23617
  }
23468
23618
  }
23469
23619
  }, {
23470
23620
  key: "layoutCross",
23471
- value: function layoutCross(children, alignItem, cross, anchorPos, lenArray, currSeg, lastIdx) {
23472
- if ("flex-end" === alignItem) for (var i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[cross.field] = anchorPos - lenArray[i].crossLen + getPadding(children[i], cross.field);else if ("center" === alignItem) for (var _i7 = lastIdx; _i7 <= currSeg.idx; _i7++) children[_i7].attribute[cross.field] = anchorPos - lenArray[_i7].crossLen / 2 + getPadding(children[_i7], cross.field);else for (var _i8 = lastIdx; _i8 <= currSeg.idx; _i8++) children[_i8].attribute[cross.field] = anchorPos + getPadding(children[_i8], cross.field);
23621
+ value: function layoutCross(children, alignItem, cross, anchorPosMap, lenArray, currSeg, lastIdx) {
23622
+ var _a;
23623
+ for (var i = lastIdx; i <= currSeg.idx; i++) {
23624
+ var child = children[i];
23625
+ var alignSelf = child.attribute.alignSelf;
23626
+ alignSelf && "auto" !== alignSelf || (alignSelf = alignItem);
23627
+ var b = this.getAABBBounds(child),
23628
+ anchorPos = null !== (_a = anchorPosMap[alignSelf]) && void 0 !== _a ? _a : anchorPosMap["flex-start"];
23629
+ "flex-end" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen + getPadding(child, cross.field), child.attribute[cross.field], b["".concat(cross.field, "1")])) : "center" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen / 2 + getPadding(child, cross.field), child.attribute[cross.field], b["".concat(cross.field, "1")])) : !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos + getPadding(child, cross.field), child.attribute[cross.field], b["".concat(cross.field, "1")]));
23630
+ }
23473
23631
  }
23474
23632
  }, {
23475
23633
  key: "activate",
23476
23634
  value: function activate(context) {
23477
23635
  var _this2 = this;
23478
23636
  this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, function (graphic) {
23479
- graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic), _this2.layouting = !1;
23637
+ graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage && graphic.stage === _this2.pluginService.stage && _this2.tryLayout(graphic, !1);
23480
23638
  }), application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, function (graphic, stage, willUpdate, bounds) {
23481
- graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === _this2.pluginService.stage && graphic.isContainer && _tempBounds.copy(bounds);
23639
+ graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === _this2.pluginService.stage && graphic.isContainer && !_this2.skipBoundsTrigger && _tempBounds.copy(bounds);
23482
23640
  }), application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, function (graphic, stage, bounds, params, selfChange) {
23483
- stage && stage === _this2.pluginService.stage && graphic.isContainer && (_tempBounds.equals(bounds) || (_this2.tryLayout(graphic), _this2.layouting = !1));
23641
+ stage && stage === _this2.pluginService.stage && graphic.isContainer && !_this2.skipBoundsTrigger && (_tempBounds.equals(bounds) || _this2.tryLayout(graphic, !1));
23484
23642
  }), application.graphicService.hooks.onSetStage.tap(this.key, function (graphic) {
23485
- graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic), _this2.layouting = !1;
23643
+ graphic.glyphHost && (graphic = graphic.glyphHost), _this2.tryLayout(graphic, !1);
23486
23644
  });
23487
23645
  }
23488
23646
  }, {
@@ -23491,6 +23649,10 @@
23491
23649
  var _this3 = this;
23492
23650
  application.graphicService.hooks.onAttributeUpdate.taps = application.graphicService.hooks.onAttributeUpdate.taps.filter(function (item) {
23493
23651
  return item.name !== _this3.key;
23652
+ }), application.graphicService.hooks.beforeUpdateAABBBounds.taps = application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(function (item) {
23653
+ return item.name !== _this3.key;
23654
+ }), application.graphicService.hooks.afterUpdateAABBBounds.taps = application.graphicService.hooks.afterUpdateAABBBounds.taps.filter(function (item) {
23655
+ return item.name !== _this3.key;
23494
23656
  }), application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(function (item) {
23495
23657
  return item.name !== _this3.key;
23496
23658
  });
@@ -23499,11 +23661,7 @@
23499
23661
  return FlexLayoutPlugin;
23500
23662
  }();
23501
23663
  function getPadding(graphic, field) {
23502
- if (!graphic.attribute.boundsPadding) return 0;
23503
- if (isNumber(graphic.attribute.boundsPadding)) return graphic.attribute.boundsPadding;
23504
- if (isArray$1(graphic.attribute.boundsPadding) && 1 === graphic.attribute.boundsPadding.length) return graphic.attribute.boundsPadding[0];
23505
- var paddingArray = parsePadding(graphic.attribute.boundsPadding);
23506
- return "x" === field ? paddingArray[3] : "y" === field ? paddingArray[0] : 0;
23664
+ return 0;
23507
23665
  }
23508
23666
 
23509
23667
  var defaultTicker = new DefaultTicker();
@@ -23703,7 +23861,13 @@
23703
23861
  _classCallCheck(this, Stage);
23704
23862
  var _a;
23705
23863
  _this = _super.call(this, {}), _this._onVisibleChange = function (visible) {
23706
- _this._skipRender < 0 || (visible ? (_this.dirtyBounds && _this.dirtyBounds.setValue(0, 0, _this._viewBox.width(), _this._viewBox.height()), _this._skipRender > 1 && _this.renderNextFrame(), _this._skipRender = 0) : _this._skipRender = 1);
23864
+ if (!(_this._skipRender < 0)) if (visible) {
23865
+ if (_this.dirtyBounds) {
23866
+ var b = _this.window.getViewBox();
23867
+ _this.dirtyBounds.setValue(b.x1, b.y1, b.width(), b.height());
23868
+ }
23869
+ _this._skipRender > 1 && _this.renderNextFrame(), _this._skipRender = 0;
23870
+ } else _this._skipRender = 1;
23707
23871
  }, _this.beforeRender = function (stage) {
23708
23872
  _this._beforeRender && _this._beforeRender(stage);
23709
23873
  }, _this.afterRender = function (stage) {
@@ -23716,12 +23880,13 @@
23716
23880
  }, _this.global = application.global, !_this.global.env && isBrowserEnv() && _this.global.setEnv("browser"), _this.window = container.get(VWindow), _this.renderService = container.get(RenderService), _this.pluginService = container.get(PluginService), _this.layerService = container.get(LayerService), _this.pluginService.active(_assertThisInitialized(_this), params), _this.window.create({
23717
23881
  width: params.width,
23718
23882
  height: params.height,
23883
+ viewBox: params.viewBox,
23719
23884
  container: params.container,
23720
23885
  dpr: params.dpr || _this.global.devicePixelRatio,
23721
23886
  canvasControled: !1 !== params.canvasControled,
23722
23887
  title: params.title || "",
23723
23888
  canvas: params.canvas
23724
- }), _this._viewBox = new AABBBounds(), params.viewBox ? _this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2) : _this._viewBox.setValue(0, 0, _this.width, _this.height), _this.state = "normal", _this.renderCount = 0, _this.tryInitEventSystem(), _this._subView = !(_this._viewBox.width() === _this.width && _this._viewBox.height() === _this.height), _this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, _this.appendChild(_this.layerService.createLayer(_assertThisInitialized(_this), {
23889
+ }), _this.state = "normal", _this.renderCount = 0, _this.tryInitEventSystem(), _this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, _this.appendChild(_this.layerService.createLayer(_assertThisInitialized(_this), {
23725
23890
  main: !0
23726
23891
  })), _this.nextFrameRenderLayerSet = new Set(), _this.willNextFrameRender = !1, _this.stage = _assertThisInitialized(_this), _this.renderStyle = params.renderStyle, params.autoRender && _this.enableAutoRender(), !1 === params.disableDirtyBounds && _this.enableDirtyBounds(), params.enableHtmlAttribute && _this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && _this.enableLayout(), _this.hooks.beforeRender.tap("constructor", _this.beforeRender), _this.hooks.afterRender.tap("constructor", _this.afterRender), _this._beforeRender = params.beforeRender, _this._afterRender = params.afterRender, _this.ticker = params.ticker || defaultTicker, _this.supportInteractiveLayer = !1 !== params.interactiveLayer, _this.timeline = new DefaultTimeline(), _this.ticker.addTimeline(_this.timeline), _this.timeline.pause(), params.optimize || (params.optimize = {}), _this.optmize(params.optimize), params.background && isString$1(_this._background) && _this._background.includes("/") && _this.setAttributes({
23727
23892
  background: _this._background
@@ -23731,26 +23896,28 @@
23731
23896
  _createClass(Stage, [{
23732
23897
  key: "viewBox",
23733
23898
  get: function get() {
23734
- return this._viewBox;
23899
+ return this.window.getViewBox();
23735
23900
  },
23736
23901
  set: function set(b) {
23737
- this._viewBox.setValue(b.x1, b.y1, b.x2, b.y2);
23902
+ this.window.setViewBox(b);
23738
23903
  }
23739
23904
  }, {
23740
23905
  key: "x",
23741
23906
  get: function get() {
23742
- return this._viewBox.x1;
23907
+ return this.window.getViewBox().x1;
23743
23908
  },
23744
23909
  set: function set(x) {
23745
- this._viewBox.translate(x - this._viewBox.x1, 0);
23910
+ var b = this.window.getViewBox();
23911
+ b.translate(x - b.x1, 0), this.window.setViewBox(b);
23746
23912
  }
23747
23913
  }, {
23748
23914
  key: "y",
23749
23915
  get: function get() {
23750
- return this._viewBox.y1;
23916
+ return this.window.getViewBox().y1;
23751
23917
  },
23752
23918
  set: function set(y) {
23753
- this._viewBox.translate(0, y - this._viewBox.y1);
23919
+ var b = this.window.getViewBox();
23920
+ b.translate(0, y - b.y1), this.window.setViewBox(b);
23754
23921
  }
23755
23922
  }, {
23756
23923
  key: "width",
@@ -23763,7 +23930,7 @@
23763
23930
  }, {
23764
23931
  key: "viewWidth",
23765
23932
  get: function get() {
23766
- return this._viewBox.width();
23933
+ return this.window.getViewBox().width();
23767
23934
  },
23768
23935
  set: function set(w) {
23769
23936
  this.resizeView(w, this.viewHeight);
@@ -23771,7 +23938,7 @@
23771
23938
  }, {
23772
23939
  key: "viewHeight",
23773
23940
  get: function get() {
23774
- return this._viewBox.height();
23941
+ return this.window.getViewBox().height();
23775
23942
  },
23776
23943
  set: function set(h) {
23777
23944
  this.resizeView(this.viewWidth, h);
@@ -23811,6 +23978,16 @@
23811
23978
  get: function get() {
23812
23979
  return this._eventSystem;
23813
23980
  }
23981
+ }, {
23982
+ key: "pauseRender",
23983
+ value: function pauseRender() {
23984
+ this._skipRender = -1;
23985
+ }
23986
+ }, {
23987
+ key: "resumeRender",
23988
+ value: function resumeRender() {
23989
+ this._skipRender = 0;
23990
+ }
23814
23991
  }, {
23815
23992
  key: "tryInitEventSystem",
23816
23993
  value: function tryInitEventSystem() {
@@ -23820,22 +23997,7 @@
23820
23997
  rootNode: this,
23821
23998
  global: this.global,
23822
23999
  supportsPointerEvents: this.params.supportsPointerEvents,
23823
- supportsTouchEvents: this.params.supportsTouchEvents,
23824
- viewport: {
23825
- viewBox: this._viewBox,
23826
- get x() {
23827
- return this.viewBox.x1;
23828
- },
23829
- get y() {
23830
- return this.viewBox.y1;
23831
- },
23832
- get width() {
23833
- return this.viewBox.width();
23834
- },
23835
- get height() {
23836
- return this.viewBox.height();
23837
- }
23838
- }
24000
+ supportsTouchEvents: this.params.supportsTouchEvents
23839
24001
  }, this.params.event)));
23840
24002
  }
23841
24003
  }, {
@@ -24027,10 +24189,15 @@
24027
24189
  _this7.pluginService.unRegister(plugin);
24028
24190
  }));
24029
24191
  }
24192
+ }, {
24193
+ key: "getPluginsByName",
24194
+ value: function getPluginsByName(name) {
24195
+ return this.pluginService.findPluginsByName(name);
24196
+ }
24030
24197
  }, {
24031
24198
  key: "tryUpdateAABBBounds",
24032
24199
  value: function tryUpdateAABBBounds() {
24033
- var viewBox = this._viewBox;
24200
+ var viewBox = this.window.getViewBox();
24034
24201
  return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2), this._AABBBounds;
24035
24202
  }
24036
24203
  }, {
@@ -24070,14 +24237,14 @@
24070
24237
  }, {
24071
24238
  key: "clearViewBox",
24072
24239
  value: function clearViewBox(color) {
24073
- this.window.clearViewBox(this._viewBox, color);
24240
+ this.window.clearViewBox(color);
24074
24241
  }
24075
24242
  }, {
24076
24243
  key: "render",
24077
24244
  value: function render(layers, params) {
24078
24245
  this.ticker.start(), this.timeline.resume();
24079
24246
  var state = this.state;
24080
- this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
24247
+ this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
24081
24248
  }
24082
24249
  }, {
24083
24250
  key: "combineLayersToWindow",
@@ -24097,7 +24264,7 @@
24097
24264
  value: function _doRenderInThisFrame() {
24098
24265
  this.timeline.resume(), this.ticker.start();
24099
24266
  var state = this.state;
24100
- this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.hooks.afterRender.call(this), this.nextFrameRenderLayerSet.clear()), this.state = state, this._skipRender && this._skipRender++;
24267
+ this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
24101
24268
  }
24102
24269
  }, {
24103
24270
  key: "renderLayerList",
@@ -24112,13 +24279,17 @@
24112
24279
  layer.renderCount > _this10.renderCount || (layer.renderCount = _this10.renderCount + 1, layer.render({
24113
24280
  renderService: _this10.renderService,
24114
24281
  background: layer === _this10.defaultLayer ? _this10.background : void 0,
24115
- updateBounds: !(!_this10.dirtyBounds || _this10.dirtyBounds.empty())
24282
+ updateBounds: !(!_this10.dirtyBounds || _this10.dirtyBounds.empty()),
24283
+ viewBox: _this10.window.getViewBox(),
24284
+ transMatrix: _this10.window.getViewBoxTransform()
24116
24285
  }, Object.assign({
24117
24286
  renderStyle: _this10.renderStyle
24118
24287
  }, params)));
24119
24288
  }), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
24120
24289
  renderService: this.renderService,
24121
- updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
24290
+ updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty()),
24291
+ viewBox: this.window.getViewBox(),
24292
+ transMatrix: this.window.getViewBoxTransform()
24122
24293
  }, Object.assign({
24123
24294
  renderStyle: this.renderStyle
24124
24295
  }, params));
@@ -24133,9 +24304,9 @@
24133
24304
  key: "resize",
24134
24305
  value: function resize(w, h) {
24135
24306
  var rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
24136
- this.window.resize(w, h), this.forEachChildren(function (c) {
24307
+ this.window.hasSubView() || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.window.resize(w, h), this.forEachChildren(function (c) {
24137
24308
  c.resize(w, h);
24138
- }), this._subView || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render();
24309
+ }), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render();
24139
24310
  }
24140
24311
  }, {
24141
24312
  key: "resizeView",
@@ -24218,50 +24389,44 @@
24218
24389
  }
24219
24390
  }, {
24220
24391
  key: "renderTo",
24221
- value: function renderTo(window, params) {
24392
+ value: function renderTo(window) {
24222
24393
  var _this12 = this;
24223
24394
  this.forEachChildren(function (layer, i) {
24224
- layer.drawTo(window, Object.assign(Object.assign({}, params), {
24395
+ layer.drawTo(window, {
24225
24396
  renderService: _this12.renderService,
24397
+ viewBox: window.getViewBox(),
24398
+ transMatrix: window.getViewBoxTransform(),
24226
24399
  background: layer === _this12.defaultLayer ? _this12.background : void 0,
24227
24400
  clear: 0 === i,
24228
24401
  updateBounds: !(!_this12.dirtyBounds || _this12.dirtyBounds.empty())
24229
- }));
24402
+ });
24230
24403
  });
24231
24404
  }
24232
24405
  }, {
24233
24406
  key: "renderToNewWindow",
24234
24407
  value: function renderToNewWindow() {
24235
- var fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
24236
24408
  var viewBox = arguments.length > 1 ? arguments[1] : undefined;
24237
- var window = container.get(VWindow);
24238
- if (fullImage) window.create({
24239
- width: this.viewWidth,
24240
- height: this.viewHeight,
24409
+ var window = container.get(VWindow),
24410
+ x1 = viewBox ? -viewBox.x1 : 0,
24411
+ y1 = viewBox ? -viewBox.y1 : 0,
24412
+ x2 = viewBox ? viewBox.x2 : this.viewWidth,
24413
+ y2 = viewBox ? viewBox.y2 : this.viewHeight,
24414
+ width = viewBox ? viewBox.width() : this.viewWidth,
24415
+ height = viewBox ? viewBox.height() : this.viewHeight;
24416
+ return window.create({
24417
+ viewBox: {
24418
+ x1: x1,
24419
+ y1: y1,
24420
+ x2: x2,
24421
+ y2: y2
24422
+ },
24423
+ width: width,
24424
+ height: height,
24241
24425
  dpr: this.window.dpr,
24242
24426
  canvasControled: !0,
24243
24427
  offscreen: !0,
24244
24428
  title: ""
24245
- });else {
24246
- var width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x),
24247
- height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);
24248
- window.create({
24249
- width: width,
24250
- height: height,
24251
- dpr: this.window.dpr,
24252
- canvasControled: !0,
24253
- offscreen: !0,
24254
- title: ""
24255
- });
24256
- }
24257
- var x = viewBox ? -viewBox.x1 : 0,
24258
- y = viewBox ? -viewBox.y1 : 0;
24259
- return this.renderTo(window, {
24260
- x: x,
24261
- y: y,
24262
- width: viewBox ? viewBox.x2 : window.width,
24263
- height: viewBox ? viewBox.y2 : window.height
24264
- }), window;
24429
+ }), this.renderTo(window), window;
24265
24430
  }
24266
24431
  }, {
24267
24432
  key: "toCanvas",
@@ -24301,7 +24466,7 @@
24301
24466
  __metadata$S = undefined && undefined.__metadata || function (k, v) {
24302
24467
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
24303
24468
  };
24304
- var initMatrix$1 = new Matrix(1, 0, 0, 1, 0, 0),
24469
+ var initMatrix = new Matrix(1, 0, 0, 1, 0, 0),
24305
24470
  globalPoint = {
24306
24471
  x: 0,
24307
24472
  y: 0
@@ -24309,7 +24474,7 @@
24309
24474
  exports.EmptyContext2d = /*#__PURE__*/function () {
24310
24475
  function EmptyContext2d(canvas, dpr) {
24311
24476
  _classCallCheck(this, EmptyContext2d);
24312
- this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.path = new CustomPath2D();
24477
+ this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.path = new CustomPath2D(), this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0);
24313
24478
  }
24314
24479
  _createClass(EmptyContext2d, [{
24315
24480
  key: "nativeContext",
@@ -24622,7 +24787,12 @@
24622
24787
  value: function clearMatrix() {
24623
24788
  var setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
24624
24789
  var dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
24625
- this.setTransformFromMatrix(initMatrix$1, setTransform, dpr);
24790
+ this.setTransformFromMatrix(initMatrix, setTransform, dpr);
24791
+ }
24792
+ }, {
24793
+ key: "setClearMatrix",
24794
+ value: function setClearMatrix(a, b, c, d, e, f) {
24795
+ this._clearMatrix.setValue(a, b, c, d, e, f);
24626
24796
  }
24627
24797
  }, {
24628
24798
  key: "onlyTranslate",
@@ -24937,7 +25107,7 @@
24937
25107
  exports.BaseWindowHandlerContribution = /*#__PURE__*/function () {
24938
25108
  function BaseWindowHandlerContribution() {
24939
25109
  _classCallCheck(this, BaseWindowHandlerContribution);
24940
- this._uid = Generator.GenAutoIncrementId();
25110
+ this._uid = Generator.GenAutoIncrementId(), this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
24941
25111
  }
24942
25112
  _createClass(BaseWindowHandlerContribution, [{
24943
25113
  key: "onChange",
@@ -24970,6 +25140,26 @@
24970
25140
  left: 0
24971
25141
  };
24972
25142
  }
25143
+ }, {
25144
+ key: "setViewBox",
25145
+ value: function setViewBox(vb) {
25146
+ this.viewBox.setValue(vb.x1, vb.y1, vb.x2, vb.y2);
25147
+ }
25148
+ }, {
25149
+ key: "getViewBox",
25150
+ value: function getViewBox() {
25151
+ return this.viewBox;
25152
+ }
25153
+ }, {
25154
+ key: "setViewBoxTransform",
25155
+ value: function setViewBoxTransform(a, b, c, d, e, f) {
25156
+ this.modelMatrix.setValue(a, b, c, d, e, f);
25157
+ }
25158
+ }, {
25159
+ key: "getViewBoxTransform",
25160
+ value: function getViewBoxTransform() {
25161
+ return this.modelMatrix;
25162
+ }
24973
25163
  }]);
24974
25164
  return BaseWindowHandlerContribution;
24975
25165
  }();
@@ -25010,14 +25200,11 @@
25010
25200
  group: null
25011
25201
  };
25012
25202
  params.pickerService = this;
25013
- var offsetX = 0,
25014
- offsetY = 0;
25015
- if (params && params.bounds) {
25016
- if (!params.bounds.contains(point.x, point.y)) return result;
25017
- offsetX = params.bounds.x1, offsetY = params.bounds.y1;
25018
- }
25203
+ var w = params.bounds.width(),
25204
+ h = params.bounds.height();
25205
+ if (!new AABBBounds().setValue(0, 0, w, h).containsPoint(point)) return result;
25019
25206
  this.pickContext && (this.pickContext.inuse = !0), params.pickContext = this.pickContext, this.pickContext && this.pickContext.clearMatrix(!0, 1);
25020
- var parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
25207
+ var parentMatrix = new Matrix(1, 0, 0, 1, 0, 0);
25021
25208
  var group;
25022
25209
  for (var i = graphics.length - 1; i >= 0 && (result = graphics[i].isContainer ? this.pickGroup(graphics[i], point, parentMatrix, params) : this.pickItem(graphics[i], point, parentMatrix, params), !result.graphic); i--) group || (group = result.group);
25023
25210
  if (result.graphic || (result.group = group), this.pickContext && (this.pickContext.inuse = !1), result.graphic) {
@@ -28929,9 +29116,9 @@
28929
29116
  }
28930
29117
  children.length && flatten(1 === children.length ? children[0] : children, childrenList);
28931
29118
  var g = "Group" === c.name ? new c(attribute) : c(config);
28932
- return parseToGraphic(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), g;
29119
+ return parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), g;
28933
29120
  }
28934
- function parseToGraphic(g, childrenList, props) {
29121
+ function parseToGraphic$1(g, childrenList, props) {
28935
29122
  var out,
28936
29123
  isGraphic = !1;
28937
29124
  switch (g.type) {
@@ -28957,6 +29144,47 @@
28957
29144
  }
28958
29145
  var Fragment = Group;
28959
29146
 
29147
+ function decodeReactDom(dom) {
29148
+ if (!dom || !dom.$$typeof) return dom;
29149
+ var type = dom.type,
29150
+ _dom$props = dom.props,
29151
+ attribute = _dom$props.attribute,
29152
+ children = _dom$props.children,
29153
+ stateProxy = _dom$props.stateProxy,
29154
+ g = type({
29155
+ attribute: attribute
29156
+ }),
29157
+ out = parseToGraphic(g, dom.props, children);
29158
+ return out || (stateProxy && (g.stateProxy = stateProxy), g.id = attribute.id, g.name = attribute.name, isArray$1(children) ? children.forEach(function (item) {
29159
+ var c = decodeReactDom(item);
29160
+ c && c.type && g.add(c);
29161
+ }) : children && g.add(decodeReactDom(children)), g);
29162
+ }
29163
+ function parseToGraphic(g, props, childrenList) {
29164
+ var out,
29165
+ isGraphic = !1;
29166
+ switch (g.type) {
29167
+ case "richtext":
29168
+ break;
29169
+ case "rich/text":
29170
+ out = g.attribute || {}, childrenList && (out.text = childrenList), g.attribute = out;
29171
+ break;
29172
+ case "rich/image":
29173
+ out = g.attribute || {};
29174
+ break;
29175
+ default:
29176
+ isGraphic = !0;
29177
+ }
29178
+ return isGraphic ? Object.keys(props).forEach(function (k) {
29179
+ var en = REACT_TO_CANOPUS_EVENTS[k];
29180
+ en && g.on(en, props[k]);
29181
+ }) : "richtext" === g.type && (g.attribute.textConfig = childrenList.map(function (item) {
29182
+ return decodeReactDom(item);
29183
+ }).filter(function (item) {
29184
+ return item;
29185
+ })), out;
29186
+ }
29187
+
28960
29188
  var DragNDrop = /*#__PURE__*/function () {
28961
29189
  function DragNDrop(rootNode) {
28962
29190
  var _this = this;
@@ -29258,7 +29486,6 @@
29258
29486
  if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
29259
29487
  };
29260
29488
  var outP = [0, 0, 0],
29261
- initMatrix = new Matrix(1, 0, 0, 1, 0, 0),
29262
29489
  addArcToBezierPath = function addArcToBezierPath(bezierPath, startAngle, endAngle, cx, cy, rx, ry, clockwise) {
29263
29490
  if (clockwise) for (; endAngle > startAngle;) endAngle -= pi2;else for (; endAngle < startAngle;) endAngle += pi2;
29264
29491
  var step = pi / 3 * (endAngle > startAngle ? 1 : -1);
@@ -29294,7 +29521,7 @@
29294
29521
  }), this._clearShadowStyle = !1, this._clearFilterStyle = !1, this._clearGlobalCompositeOperationStyle = !1;
29295
29522
  var context = canvas.nativeCanvas.getContext("2d");
29296
29523
  if (!context) throw new Error("发生错误,获取2d上下文失败");
29297
- this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0);
29524
+ this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0);
29298
29525
  }
29299
29526
  _createClass(BrowserContext2d, [{
29300
29527
  key: "fillStyle",
@@ -29930,7 +30157,12 @@
29930
30157
  value: function clearMatrix() {
29931
30158
  var setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
29932
30159
  var dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
29933
- this.setTransformFromMatrix(initMatrix, setTransform, dpr);
30160
+ this.setTransformFromMatrix(this._clearMatrix, setTransform, dpr);
30161
+ }
30162
+ }, {
30163
+ key: "setClearMatrix",
30164
+ value: function setClearMatrix(a, b, c, d, e, f) {
30165
+ this._clearMatrix.setValue(a, b, c, d, e, f);
29934
30166
  }
29935
30167
  }, {
29936
30168
  key: "onlyTranslate",
@@ -30214,7 +30446,7 @@
30214
30446
  function BrowserWindowHandlerContribution_1() {
30215
30447
  var _this;
30216
30448
  _classCallCheck(this, BrowserWindowHandlerContribution_1);
30217
- _this = _super.call(this), _this.type = "browser", _this._canvasIsIntersecting = !0, _this.global = application.global;
30449
+ _this = _super.call(this), _this.type = "browser", _this._canvasIsIntersecting = !0, _this.global = application.global, _this.viewBox = new AABBBounds(), _this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
30218
30450
  return _this;
30219
30451
  }
30220
30452
  _createClass(BrowserWindowHandlerContribution_1, [{
@@ -30395,8 +30627,9 @@
30395
30627
  }
30396
30628
  }, {
30397
30629
  key: "clearViewBox",
30398
- value: function clearViewBox(vb, color) {
30399
- var context = this.getContext(),
30630
+ value: function clearViewBox(color) {
30631
+ var vb = this.viewBox,
30632
+ context = this.getContext(),
30400
30633
  dpr = this.getDpr();
30401
30634
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
30402
30635
  }
@@ -31000,8 +31233,9 @@
31000
31233
  }
31001
31234
  }, {
31002
31235
  key: "clearViewBox",
31003
- value: function clearViewBox(vb, color) {
31004
- var context = this.getContext(),
31236
+ value: function clearViewBox(color) {
31237
+ var vb = this.viewBox,
31238
+ context = this.getContext(),
31005
31239
  dpr = this.getDpr();
31006
31240
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
31007
31241
  }
@@ -31648,8 +31882,9 @@
31648
31882
  }
31649
31883
  }, {
31650
31884
  key: "clearViewBox",
31651
- value: function clearViewBox(vb, color) {
31652
- var context = this.getContext(),
31885
+ value: function clearViewBox(color) {
31886
+ var vb = this.viewBox,
31887
+ context = this.getContext(),
31653
31888
  dpr = this.getDpr();
31654
31889
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
31655
31890
  }
@@ -32049,7 +32284,7 @@
32049
32284
  }
32050
32285
  }, {
32051
32286
  key: "clearViewBox",
32052
- value: function clearViewBox(vb, color) {}
32287
+ value: function clearViewBox(color) {}
32053
32288
  }]);
32054
32289
  return NodeWindowHandlerContribution;
32055
32290
  }(exports.BaseWindowHandlerContribution);
@@ -32579,8 +32814,9 @@
32579
32814
  }
32580
32815
  }, {
32581
32816
  key: "clearViewBox",
32582
- value: function clearViewBox(vb, color) {
32583
- var context = this.getContext(),
32817
+ value: function clearViewBox(color) {
32818
+ var vb = this.viewBox,
32819
+ context = this.getContext(),
32584
32820
  dpr = this.getDpr();
32585
32821
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
32586
32822
  }
@@ -33011,8 +33247,9 @@
33011
33247
  }
33012
33248
  }, {
33013
33249
  key: "clearViewBox",
33014
- value: function clearViewBox(vb, color) {
33015
- var context = this.getContext(),
33250
+ value: function clearViewBox(color) {
33251
+ var vb = this.viewBox,
33252
+ context = this.getContext(),
33016
33253
  dpr = this.getDpr();
33017
33254
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
33018
33255
  }
@@ -33408,7 +33645,7 @@
33408
33645
  x += _point.x, y += _point.y, pickContext.setTransformForCurrent();
33409
33646
  } else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
33410
33647
  var picked = !0;
33411
- if (!onlyTranslate || rect.shadowRoot || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(function (num) {
33648
+ if (!onlyTranslate || rect.shadowRoot || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(function (num) {
33412
33649
  return 0 !== num;
33413
33650
  })) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, function (context, rectAttribute, themeAttribute) {
33414
33651
  return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
@@ -33486,7 +33723,7 @@
33486
33723
  x += _point.x, y += _point.y, pickContext.setTransformForCurrent();
33487
33724
  } else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
33488
33725
  var picked = !0;
33489
- if (!onlyTranslate || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(function (num) {
33726
+ if (!onlyTranslate || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(function (num) {
33490
33727
  return 0 !== num;
33491
33728
  })) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, function (context, rectAttribute, themeAttribute) {
33492
33729
  return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
@@ -34853,7 +35090,7 @@
34853
35090
 
34854
35091
  var roughModule = _roughModule;
34855
35092
 
34856
- const version = "0.17.19";
35093
+ const version = "0.17.20-alpha.10";
34857
35094
  preLoadAllModule();
34858
35095
  if (isBrowserEnv()) {
34859
35096
  loadBrowserEnv(container);
@@ -34904,6 +35141,7 @@
34904
35141
  exports.BoundsContext = BoundsContext;
34905
35142
  exports.BoundsPicker = BoundsPicker;
34906
35143
  exports.CIRCLE_NUMBER_TYPE = CIRCLE_NUMBER_TYPE;
35144
+ exports.Canvas3DDrawItemInterceptor = Canvas3DDrawItemInterceptor;
34907
35145
  exports.CanvasFactory = CanvasFactory;
34908
35146
  exports.CanvasTextLayout = CanvasTextLayout;
34909
35147
  exports.CbAnimate = CbAnimate;
@@ -34925,6 +35163,7 @@
34925
35163
  exports.CustomEvent = CustomEvent;
34926
35164
  exports.CustomPath2D = CustomPath2D;
34927
35165
  exports.CustomSymbolClass = CustomSymbolClass;
35166
+ exports.DebugDrawItemInterceptorContribution = DebugDrawItemInterceptorContribution;
34928
35167
  exports.DefaultArcAllocate = DefaultArcAllocate;
34929
35168
  exports.DefaultArcAttribute = DefaultArcAttribute;
34930
35169
  exports.DefaultArcRenderContribution = DefaultArcRenderContribution;
@@ -34978,6 +35217,7 @@
34978
35217
  exports.DefaultTransform = DefaultTransform;
34979
35218
  exports.DragNDrop = DragNDrop;
34980
35219
  exports.DrawContribution = DrawContribution;
35220
+ exports.DrawItemInterceptor = DrawItemInterceptor;
34981
35221
  exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
34982
35222
  exports.EnvContribution = EnvContribution;
34983
35223
  exports.EventManager = EventManager;
@@ -35016,6 +35256,7 @@
35016
35256
  exports.IncreaseCount = IncreaseCount;
35017
35257
  exports.IncrementalDrawContribution = IncrementalDrawContribution;
35018
35258
  exports.InputText = InputText;
35259
+ exports.InteractiveDrawItemInterceptorContribution = InteractiveDrawItemInterceptorContribution;
35019
35260
  exports.InteractiveSubRenderContribution = InteractiveSubRenderContribution;
35020
35261
  exports.LINE_NUMBER_TYPE = LINE_NUMBER_TYPE;
35021
35262
  exports.Layer = Layer;
@@ -35077,6 +35318,7 @@
35077
35318
  exports.SYMBOL_NUMBER_TYPE = SYMBOL_NUMBER_TYPE;
35078
35319
  exports.SegContext = SegContext;
35079
35320
  exports.ShadowRoot = ShadowRoot;
35321
+ exports.ShadowRootDrawItemInterceptorContribution = ShadowRootDrawItemInterceptorContribution;
35080
35322
  exports.Stage = Stage;
35081
35323
  exports.StaticLayerHandlerContribution = StaticLayerHandlerContribution;
35082
35324
  exports.Step = Step$1;
@@ -35183,6 +35425,7 @@
35183
35425
  exports.cubicLength = cubicLength;
35184
35426
  exports.cubicPointAt = cubicPointAt;
35185
35427
  exports.cubicSubdivide = cubicSubdivide;
35428
+ exports.decodeReactDom = decodeReactDom;
35186
35429
  exports.defaultArcAllocate = defaultArcAllocate;
35187
35430
  exports.defaultArcBackgroundRenderContribution = defaultArcBackgroundRenderContribution;
35188
35431
  exports.defaultArcRenderContribution = defaultArcRenderContribution;