@visactor/vrender 0.22.9-alpha.1 → 0.22.9

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
@@ -492,14 +492,11 @@
492
492
  const ContributionProvider = Symbol("ContributionProvider");
493
493
  class ContributionProviderCache {
494
494
  constructor(serviceIdentifier, container) {
495
- this.serviceIdentifier = serviceIdentifier, this.container = container, ContributionStore.setStore(this.serviceIdentifier, this);
495
+ this.serviceIdentifier = serviceIdentifier, this.container = container;
496
496
  }
497
497
  getContributions() {
498
498
  return this.caches || (this.caches = [], this.container && this.container.isBound(this.serviceIdentifier) && this.caches.push(...this.container.getAll(this.serviceIdentifier))), this.caches;
499
499
  }
500
- refresh() {
501
- this.caches && (this.caches.length = 0, this.container && this.container.isBound(this.serviceIdentifier) && this.caches.push(...this.container.getAll(this.serviceIdentifier)));
502
- }
503
500
  }
504
501
  function bindContributionProvider(bind, id) {
505
502
  bind(ContributionProvider).toDynamicValue(_ref => {
@@ -517,20 +514,6 @@
517
514
  return new ContributionProviderCache(id, container);
518
515
  }).whenTargetNamed(id);
519
516
  }
520
- class ContributionStore {
521
- static getStore(id) {
522
- return this.store.get(id);
523
- }
524
- static setStore(id, cache) {
525
- this.store.set(id, cache);
526
- }
527
- static refreshAllContributions() {
528
- this.store.forEach(cache => {
529
- cache.refresh();
530
- });
531
- }
532
- }
533
- ContributionStore.store = new Map();
534
517
 
535
518
  class Hook {
536
519
  constructor(args, name) {
@@ -597,48 +580,6 @@
597
580
  const VGlobal = Symbol.for("VGlobal");
598
581
  const DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";
599
582
 
600
- class EventListenerManager {
601
- constructor() {
602
- this._listenerMap = new Map(), this._eventListenerTransformer = event => event;
603
- }
604
- setEventListenerTransformer(transformer) {
605
- this._eventListenerTransformer = transformer || (event => event);
606
- }
607
- addEventListener(type, listener, options) {
608
- if (!listener) return;
609
- const wrappedListener = event => {
610
- const transformedEvent = this._eventListenerTransformer(event);
611
- "function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent);
612
- };
613
- this._listenerMap.has(type) || this._listenerMap.set(type, new Map()), this._listenerMap.get(type).set(listener, wrappedListener), this._nativeAddEventListener(type, wrappedListener, options);
614
- }
615
- removeEventListener(type, listener, options) {
616
- var _a;
617
- if (!listener) return;
618
- const wrappedListener = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener);
619
- wrappedListener && (this._nativeRemoveEventListener(type, wrappedListener, options), this._listenerMap.get(type).delete(listener), 0 === this._listenerMap.get(type).size && this._listenerMap.delete(type));
620
- }
621
- dispatchEvent(event) {
622
- return this._nativeDispatchEvent(event);
623
- }
624
- clearAllEventListeners() {
625
- this._listenerMap.forEach((listenersMap, type) => {
626
- listenersMap.forEach((wrappedListener, originalListener) => {
627
- this._nativeRemoveEventListener(type, wrappedListener, void 0);
628
- });
629
- }), this._listenerMap.clear();
630
- }
631
- _nativeAddEventListener(type, listener, options) {
632
- throw new Error("_nativeAddEventListener must be implemented by derived classes");
633
- }
634
- _nativeRemoveEventListener(type, listener, options) {
635
- throw new Error("_nativeRemoveEventListener must be implemented by derived classes");
636
- }
637
- _nativeDispatchEvent(event) {
638
- throw new Error("_nativeDispatchEvent must be implemented by derived classes");
639
- }
640
- }
641
-
642
583
  var __decorate$1N = undefined && undefined.__decorate || function (decorators, target, key, desc) {
643
584
  var d,
644
585
  c = arguments.length,
@@ -679,7 +620,7 @@
679
620
  step((generator = generator.apply(thisArg, _arguments || [])).next());
680
621
  });
681
622
  };
682
- exports.DefaultGlobal = class DefaultGlobal extends EventListenerManager {
623
+ exports.DefaultGlobal = class DefaultGlobal {
683
624
  get env() {
684
625
  return this._env;
685
626
  }
@@ -723,19 +664,10 @@
723
664
  this._env || this.setEnv("browser"), this.envContribution.applyStyles = support;
724
665
  }
725
666
  constructor(contributions) {
726
- super(), this.contributions = contributions, this._isImageAnonymous = !0, this.eventListenerTransformer = event => event, this.id = Generator.GenAutoIncrementId(), this.hooks = {
667
+ this.contributions = contributions, this._isImageAnonymous = !0, this.id = Generator.GenAutoIncrementId(), this.hooks = {
727
668
  onSetEnv: new SyncHook(["lastEnv", "env", "global"])
728
669
  }, this.measureTextMethod = "native", this.optimizeVisible = !1;
729
670
  }
730
- _nativeAddEventListener(type, listener, options) {
731
- return this._env || this.setEnv("browser"), this.envContribution.addEventListener(type, listener, options);
732
- }
733
- _nativeRemoveEventListener(type, listener, options) {
734
- return this._env || this.setEnv("browser"), this.envContribution.removeEventListener(type, listener, options);
735
- }
736
- _nativeDispatchEvent(event) {
737
- return this._env || this.setEnv("browser"), this.envContribution.dispatchEvent(event);
738
- }
739
671
  bindContribution(params) {
740
672
  const promiseArr = [];
741
673
  if (this.contributions.getContributions().forEach(contribution => {
@@ -776,6 +708,15 @@
776
708
  releaseCanvas(canvas) {
777
709
  return this._env || this.setEnv("browser"), this.envContribution.releaseCanvas(canvas);
778
710
  }
711
+ addEventListener(type, listener, options) {
712
+ return this._env || this.setEnv("browser"), this.envContribution.addEventListener(type, listener, options);
713
+ }
714
+ removeEventListener(type, listener, options) {
715
+ return this._env || this.setEnv("browser"), this.envContribution.removeEventListener(type, listener, options);
716
+ }
717
+ dispatchEvent(event) {
718
+ return this._env || this.setEnv("browser"), this.envContribution.dispatchEvent(event);
719
+ }
779
720
  getRequestAnimationFrame() {
780
721
  return this._env || this.setEnv("browser"), this.envContribution.getRequestAnimationFrame();
781
722
  }
@@ -1237,14 +1178,14 @@
1237
1178
  };
1238
1179
  var isArrayLike$1 = isArrayLike;
1239
1180
 
1240
- const isNumber$1 = function (value) {
1181
+ const isNumber = function (value) {
1241
1182
  let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
1242
1183
  const type = typeof value;
1243
1184
  return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
1244
1185
  };
1245
- var isNumber$2 = isNumber$1;
1186
+ var isNumber$1 = isNumber;
1246
1187
 
1247
- const isValidNumber = value => isNumber$2(value) && Number.isFinite(value);
1188
+ const isValidNumber = value => isNumber$1(value) && Number.isFinite(value);
1248
1189
  var isValidNumber$1 = isValidNumber;
1249
1190
 
1250
1191
  const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
@@ -1327,7 +1268,7 @@
1327
1268
  }(LoggerLevel || (LoggerLevel = {}));
1328
1269
  class Logger {
1329
1270
  static getInstance(level, method) {
1330
- return Logger._instance && isNumber$2(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
1271
+ return Logger._instance && isNumber$1(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
1331
1272
  }
1332
1273
  static setInstance(logger) {
1333
1274
  return Logger._instance = logger;
@@ -1471,10 +1412,10 @@
1471
1412
  return this.x = x, this.y = y, this;
1472
1413
  }
1473
1414
  add(point) {
1474
- return isNumber$2(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
1415
+ return isNumber$1(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
1475
1416
  }
1476
1417
  sub(point) {
1477
- return isNumber$2(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
1418
+ return isNumber$1(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
1478
1419
  }
1479
1420
  multi(point) {
1480
1421
  throw new Error("暂不支持");
@@ -2535,10 +2476,10 @@
2535
2476
  return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
2536
2477
  }
2537
2478
  function rgb(value) {
2538
- 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);
2479
+ 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);
2539
2480
  }
2540
2481
  function rgba(value) {
2541
- 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);
2482
+ 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);
2542
2483
  }
2543
2484
  function SRGBToLinear(c) {
2544
2485
  return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
@@ -3576,6 +3517,11 @@
3576
3517
  return this.context.tryUpdateLength();
3577
3518
  }
3578
3519
  };
3520
+ class StepClosed extends Step$1 {
3521
+ lineEnd() {
3522
+ this.context.closePath();
3523
+ }
3524
+ }
3579
3525
  function genStepSegments(points, t) {
3580
3526
  let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3581
3527
  const {
@@ -3589,6 +3535,16 @@
3589
3535
  function genStepTypeSegments(path, points) {
3590
3536
  return genCurveSegments(path, points);
3591
3537
  }
3538
+ function genStepClosedSegments(points, t) {
3539
+ let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3540
+ const {
3541
+ direction: direction,
3542
+ startPoint: startPoint
3543
+ } = params;
3544
+ if (points.length < 2 - Number(!!startPoint)) return null;
3545
+ const segContext = new SegContext("step", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
3546
+ return genStepTypeSegments(new StepClosed(segContext, t, startPoint), points), segContext;
3547
+ }
3592
3548
 
3593
3549
  class LinearClosed extends Linear {
3594
3550
  lineEnd() {
@@ -3818,6 +3774,8 @@
3818
3774
  return genMonotoneYSegments(points, params);
3819
3775
  case "step":
3820
3776
  return genStepSegments(points, .5, params);
3777
+ case "stepClosed":
3778
+ return genStepClosedSegments(points, .5, params);
3821
3779
  case "stepBefore":
3822
3780
  return genStepSegments(points, 0, params);
3823
3781
  case "stepAfter":
@@ -5307,9 +5265,6 @@
5307
5265
  function isNotAroundZero(val) {
5308
5266
  return val > EPSILON || val < -EPSILON;
5309
5267
  }
5310
- function isNumber(data) {
5311
- return "number" == typeof data && Number.isFinite(data);
5312
- }
5313
5268
  const _v0 = [0, 0],
5314
5269
  _v1 = [0, 0],
5315
5270
  _v2 = [0, 0];
@@ -5714,7 +5669,7 @@
5714
5669
  };
5715
5670
  const VWindow = Symbol.for("VWindow");
5716
5671
  const WindowHandlerContribution = Symbol.for("WindowHandlerContribution");
5717
- exports.DefaultWindow = class DefaultWindow extends EventListenerManager {
5672
+ exports.DefaultWindow = class DefaultWindow {
5718
5673
  get width() {
5719
5674
  if (this._handler) {
5720
5675
  const wh = this._handler.getWH();
@@ -5733,7 +5688,7 @@
5733
5688
  return this._handler.getDpr();
5734
5689
  }
5735
5690
  constructor() {
5736
- super(), this.hooks = {
5691
+ this.hooks = {
5737
5692
  onChange: new SyncHook(["x", "y", "width", "height"])
5738
5693
  }, this.active = () => {
5739
5694
  const global = this.global;
@@ -5741,15 +5696,6 @@
5741
5696
  container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
5742
5697
  }, this._uid = Generator.GenAutoIncrementId(), this.global = application.global, this.postInit();
5743
5698
  }
5744
- _nativeAddEventListener(type, listener, options) {
5745
- return this._handler.addEventListener(type, listener, options);
5746
- }
5747
- _nativeRemoveEventListener(type, listener, options) {
5748
- return this._handler.removeEventListener(type, listener, options);
5749
- }
5750
- _nativeDispatchEvent(event) {
5751
- return this._handler.dispatchEvent(event);
5752
- }
5753
5699
  postInit() {
5754
5700
  this.global.hooks.onSetEnv.tap("window", this.active), this.active();
5755
5701
  }
@@ -5789,7 +5735,7 @@
5789
5735
  throw new Error("暂不支持");
5790
5736
  }
5791
5737
  release() {
5792
- return this.global.hooks.onSetEnv.unTap("window", this.active), this.clearAllEventListeners(), this._handler.releaseWindow();
5738
+ return this.global.hooks.onSetEnv.unTap("window", this.active), this._handler.releaseWindow();
5793
5739
  }
5794
5740
  getContext() {
5795
5741
  return this._handler.getContext();
@@ -5800,6 +5746,15 @@
5800
5746
  getImageBuffer(type) {
5801
5747
  return this._handler.getImageBuffer ? this._handler.getImageBuffer(type) : null;
5802
5748
  }
5749
+ addEventListener(type, listener, options) {
5750
+ return this._handler.addEventListener(type, listener, options);
5751
+ }
5752
+ removeEventListener(type, listener, options) {
5753
+ return this._handler.removeEventListener(type, listener, options);
5754
+ }
5755
+ dispatchEvent(event) {
5756
+ return this._handler.dispatchEvent(event);
5757
+ }
5803
5758
  getBoundingClientRect() {
5804
5759
  return this._handler.getBoundingClientRect();
5805
5760
  }
@@ -7008,17 +6963,19 @@
7008
6963
  globalObj: globalObj,
7009
6964
  domElement: domElement
7010
6965
  } = this;
7011
- this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.addEventListener("pointermove", this.onPointerMove, !0), globalObj.addEventListener("pointerup", this.onPointerUp, !0)) : (domElement.addEventListener("pointermove", this.onPointerMove, !0), domElement.addEventListener("pointerup", this.onPointerUp, !0)), domElement.addEventListener("pointerdown", this.onPointerDown, !0), domElement.addEventListener("pointerleave", this.onPointerOverOut, !0), domElement.addEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.addEventListener("mousemove", this.onPointerMove, !0), globalObj.addEventListener("mouseup", this.onPointerUp, !0)) : (domElement.addEventListener("mousemove", this.onPointerMove, !0), domElement.addEventListener("mouseup", this.onPointerUp, !0)), domElement.addEventListener("mousedown", this.onPointerDown, !0), domElement.addEventListener("mouseout", this.onPointerOverOut, !0), domElement.addEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.addEventListener("touchstart", this.onPointerDown, !0), domElement.addEventListener("touchend", this.onPointerUp, !0), domElement.addEventListener("touchmove", this.onPointerMove, !0)), domElement.addEventListener("wheel", this.onWheel, {
6966
+ this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.getDocument().addEventListener("pointermove", this.onPointerMove, !0), globalObj.getDocument().addEventListener("pointerup", this.onPointerUp, !0)) : (domElement.addEventListener("pointermove", this.onPointerMove, !0), domElement.addEventListener("pointerup", this.onPointerUp, !0)), domElement.addEventListener("pointerdown", this.onPointerDown, !0), domElement.addEventListener("pointerleave", this.onPointerOverOut, !0), domElement.addEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.getDocument().addEventListener("mousemove", this.onPointerMove, !0), globalObj.getDocument().addEventListener("mouseup", this.onPointerUp, !0)) : (domElement.addEventListener("mousemove", this.onPointerMove, !0), domElement.addEventListener("mouseup", this.onPointerUp, !0)), domElement.addEventListener("mousedown", this.onPointerDown, !0), domElement.addEventListener("mouseout", this.onPointerOverOut, !0), domElement.addEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.addEventListener("touchstart", this.onPointerDown, !0), domElement.addEventListener("touchend", this.onPointerUp, !0), domElement.addEventListener("touchmove", this.onPointerMove, !0)), domElement.addEventListener("wheel", this.onWheel, {
7012
6967
  capture: !0
7013
6968
  }), this.eventsAdded = !0;
7014
6969
  }
7015
6970
  removeEvents() {
6971
+ var _a;
7016
6972
  if (!this.eventsAdded || !this.domElement) return;
7017
6973
  const {
7018
- globalObj: globalObj,
7019
- domElement: domElement
7020
- } = this;
7021
- this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.removeEventListener("pointermove", this.onPointerMove, !0), globalObj.removeEventListener("pointerup", this.onPointerUp, !0)) : (domElement.removeEventListener("pointermove", this.onPointerMove, !0), domElement.removeEventListener("pointerup", this.onPointerUp, !0)), domElement.removeEventListener("pointerdown", this.onPointerDown, !0), domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), domElement.removeEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.removeEventListener("mousemove", this.onPointerMove, !0), globalObj.removeEventListener("mouseup", this.onPointerUp, !0)) : (domElement.removeEventListener("mousemove", this.onPointerMove, !0), domElement.removeEventListener("mouseup", this.onPointerUp, !0)), domElement.removeEventListener("mousedown", this.onPointerDown, !0), domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), domElement.removeEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.removeEventListener("touchstart", this.onPointerDown, !0), domElement.removeEventListener("touchend", this.onPointerUp, !0), domElement.removeEventListener("touchmove", this.onPointerMove, !0)), domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
6974
+ globalObj: globalObj,
6975
+ domElement: domElement
6976
+ } = this,
6977
+ globalDocument = null !== (_a = globalObj.getDocument()) && void 0 !== _a ? _a : domElement;
6978
+ this.supportsPointerEvents ? (globalDocument.removeEventListener("pointermove", this.onPointerMove, !0), globalDocument.removeEventListener("pointerup", this.onPointerUp, !0), domElement.removeEventListener("pointerdown", this.onPointerDown, !0), domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), domElement.removeEventListener("pointerover", this.onPointerOverOut, !0)) : (globalDocument.removeEventListener("mousemove", this.onPointerMove, !0), globalDocument.removeEventListener("mouseup", this.onPointerUp, !0), domElement.removeEventListener("mousedown", this.onPointerDown, !0), domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), domElement.removeEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.removeEventListener("touchstart", this.onPointerDown, !0), domElement.removeEventListener("touchend", this.onPointerUp, !0), domElement.removeEventListener("touchmove", this.onPointerMove, !0)), domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
7022
6979
  }
7023
6980
  mapToViewportPoint(event) {
7024
6981
  return this.domElement.pointTransform ? this.domElement.pointTransform(event.x, event.y) : event;
@@ -8012,7 +7969,7 @@
8012
7969
  }
8013
7970
  onBind() {
8014
7971
  var _a, _b, _c, _d, _e, _f, _g, _h;
8015
- 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)));
7972
+ 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)));
8016
7973
  }
8017
7974
  onEnd() {}
8018
7975
  onUpdate(end, ratio, out) {
@@ -9155,7 +9112,7 @@
9155
9112
  return res;
9156
9113
  };
9157
9114
  const samplingPoints = (points, count) => {
9158
- const validatePoints = points.filter(point => !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y));
9115
+ const validatePoints = points.filter(point => !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y));
9159
9116
  if (0 === validatePoints.length) return [];
9160
9117
  if (1 === validatePoints.length) return new Array(count).fill(0).map(i => validatePoints[0]);
9161
9118
  const res = [];
@@ -9191,7 +9148,7 @@
9191
9148
  var _a;
9192
9149
  return res.concat(null !== (_a = seg.points) && void 0 !== _a ? _a : []);
9193
9150
  }, []));
9194
- const validatePoints = points.filter(point => !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y));
9151
+ const validatePoints = points.filter(point => !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y));
9195
9152
  if (!validatePoints.length) return [];
9196
9153
  const allPoints = [];
9197
9154
  validatePoints.forEach(point => {
@@ -9397,10 +9354,10 @@
9397
9354
 
9398
9355
  function colorArrayToString(color) {
9399
9356
  let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
9400
- return Array.isArray(color) && isNumber$2(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
9357
+ return Array.isArray(color) && isNumber$1(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
9401
9358
  }
9402
9359
  function interpolateColor(from, to, ratio, alphaChannel, cb) {
9403
- if (Array.isArray(from) && !isNumber$2(from[0]) || Array.isArray(to) && !isNumber$2(to[0])) {
9360
+ if (Array.isArray(from) && !isNumber$1(from[0]) || Array.isArray(to) && !isNumber$1(to[0])) {
9404
9361
  return new Array(4).fill(0).map((_, index) => _interpolateColor(isArray$1(from) ? from[index] : from, isArray$1(to) ? to[index] : to, ratio, alphaChannel));
9405
9362
  }
9406
9363
  return _interpolateColor(from, to, ratio, alphaChannel, cb);
@@ -9928,13 +9885,13 @@
9928
9885
 
9929
9886
  class BaseSymbol {
9930
9887
  bounds(size, bounds) {
9931
- if (isNumber$2(size)) {
9888
+ if (isNumber$1(size)) {
9932
9889
  const halfS = size / 2;
9933
9890
  bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
9934
9891
  } else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
9935
9892
  }
9936
9893
  parseSize(size) {
9937
- return isNumber$2(size) ? size : Math.min(size[0], size[1]);
9894
+ return isNumber$1(size) ? size : Math.min(size[0], size[1]);
9938
9895
  }
9939
9896
  }
9940
9897
 
@@ -10353,10 +10310,10 @@
10353
10310
  super(...arguments), this.type = "rect", this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
10354
10311
  }
10355
10312
  draw(ctx, size, x, y) {
10356
- return isNumber$2(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
10313
+ return isNumber$1(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
10357
10314
  }
10358
10315
  drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
10359
- isNumber$2(size) && (size = [size, size / 2]);
10316
+ isNumber$1(size) && (size = [size, size / 2]);
10360
10317
  const drawLength = 2 * (size[0] + size[1]) * clipRange,
10361
10318
  points = [{
10362
10319
  x: x + size[0] / 2,
@@ -10388,12 +10345,12 @@
10388
10345
  return !1;
10389
10346
  }
10390
10347
  drawOffset(ctx, size, x, y, offset) {
10391
- return isNumber$2(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
10348
+ return isNumber$1(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
10392
10349
  }
10393
10350
  }
10394
10351
  var rect = new RectSymbol();
10395
10352
 
10396
- const tempBounds$1 = new AABBBounds();
10353
+ const tempBounds = new AABBBounds();
10397
10354
  class CustomSymbolClass {
10398
10355
  constructor(type, path) {
10399
10356
  let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
@@ -10408,7 +10365,7 @@
10408
10365
  return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
10409
10366
  }
10410
10367
  parseSize(size) {
10411
- return isNumber$2(size) ? size : Math.min(size[0], size[1]);
10368
+ return isNumber$1(size) ? size : Math.min(size[0], size[1]);
10412
10369
  }
10413
10370
  drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
10414
10371
  return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
@@ -10422,7 +10379,7 @@
10422
10379
  let {
10423
10380
  path: path
10424
10381
  } = _ref;
10425
- tempBounds$1.x1 = path.bounds.x1 * size, tempBounds$1.y1 = path.bounds.y1 * size, tempBounds$1.x2 = path.bounds.x2 * size, tempBounds$1.y2 = path.bounds.y2 * size, bounds.union(tempBounds$1);
10382
+ tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size, tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
10426
10383
  });
10427
10384
  }
10428
10385
  this.path.bounds && (bounds.x1 = this.path.bounds.x1 * size, bounds.y1 = this.path.bounds.y1 * size, bounds.x2 = this.path.bounds.x2 * size, bounds.y2 = this.path.bounds.y2 * size);
@@ -10818,8 +10775,8 @@
10818
10775
  const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);
10819
10776
 
10820
10777
  const _tempBounds$1 = new AABBBounds(),
10821
- tempMatrix = new Matrix(),
10822
- tempBounds = new AABBBounds();
10778
+ tempMatrix = new Matrix();
10779
+ new AABBBounds();
10823
10780
  const PURE_STYLE_KEY = ["stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity"];
10824
10781
  const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
10825
10782
  const tempConstantXYKey = ["x", "y"],
@@ -11339,25 +11296,12 @@
11339
11296
  needUpdateLayout() {
11340
11297
  return !!(this._updateTag & exports.UpdateTag.UPDATE_LAYOUT);
11341
11298
  }
11342
- getAnchor(anchor, params) {
11299
+ getAnchor(anchor, params, resetScale) {
11343
11300
  const _anchor = [0, 0],
11344
11301
  getBounds = () => {
11345
11302
  if (params.b) return params.b;
11346
- const {
11347
- scaleX: scaleX,
11348
- scaleY: scaleY,
11349
- angle: angle,
11350
- scaleCenter: scaleCenter
11351
- } = this.attribute;
11352
- return tempBounds.copy(this._AABBBounds), this.setAttributes({
11353
- angle: 0,
11354
- scaleCenter: null
11355
- }), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
11356
- scaleX: scaleX,
11357
- scaleY: scaleY,
11358
- angle: angle,
11359
- scaleCenter: scaleCenter
11360
- }), params.b;
11303
+ const graphic = this.clone();
11304
+ return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1, graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
11361
11305
  };
11362
11306
  if ("string" == typeof anchor[0]) {
11363
11307
  const ratio = parseFloat(anchor[0]) / 100,
@@ -11386,7 +11330,7 @@
11386
11330
  const params = {};
11387
11331
  if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
11388
11332
  const m = this._transMatrix;
11389
- m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
11333
+ m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
11390
11334
  x: _anchor[0],
11391
11335
  y: _anchor[1]
11392
11336
  });
@@ -12664,12 +12608,12 @@
12664
12608
  textBaseline: textBaseline
12665
12609
  } = attribute;
12666
12610
  if (null != attribute.forceBoundsHeight) {
12667
- const h = isNumber$2(attribute.forceBoundsHeight) ? attribute.forceBoundsHeight : attribute.forceBoundsHeight(),
12611
+ const h = isNumber$1(attribute.forceBoundsHeight) ? attribute.forceBoundsHeight : attribute.forceBoundsHeight(),
12668
12612
  dy = textLayoutOffsetY(textBaseline, h, h);
12669
12613
  aabbBounds.set(aabbBounds.x1, dy, aabbBounds.x2, dy + h);
12670
12614
  }
12671
12615
  if (null != attribute.forceBoundsWidth) {
12672
- const w = isNumber$2(attribute.forceBoundsWidth) ? attribute.forceBoundsWidth : attribute.forceBoundsWidth(),
12616
+ const w = isNumber$1(attribute.forceBoundsWidth) ? attribute.forceBoundsWidth : attribute.forceBoundsWidth(),
12673
12617
  dx = textDrawOffsetX(textAlign, w);
12674
12618
  aabbBounds.set(dx, aabbBounds.y1, dx + w, aabbBounds.y2);
12675
12619
  }
@@ -14768,7 +14712,7 @@
14768
14712
  }
14769
14713
  } else {
14770
14714
  const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
14771
- if (isNumber$2(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
14715
+ if (isNumber$1(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
14772
14716
  const textParts = richTextConfig.text.split("\n");
14773
14717
  for (let j = 0; j < textParts.length; j++) if (0 === j) paragraphs.push(new Paragraph(textParts[j], !1, richTextConfig, ascentDescentMode));else if (textParts[j] || i === textConfig.length - 1) paragraphs.push(new Paragraph(textParts[j], !0, richTextConfig, ascentDescentMode));else {
14774
14718
  const nextRichTextConfig = this.combinedStyleToCharacter(textConfig[i + 1]);
@@ -15055,7 +14999,7 @@
15055
14999
  } = this.attribute;
15056
15000
  if (outerRadius += outerPadding, innerRadius -= innerPadding, 0 === cornerRadius || "0%" === cornerRadius) return 0;
15057
15001
  const deltaRadius = Math.abs(outerRadius - innerRadius),
15058
- parseCR = cornerRadius => Math.min(isNumber$2(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
15002
+ parseCR = cornerRadius => Math.min(isNumber$1(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
15059
15003
  if (isArray$1(cornerRadius)) {
15060
15004
  const crList = cornerRadius.map(cr => parseCR(cr) || 0);
15061
15005
  return 0 === crList.length ? [crList[0], crList[0], crList[0], crList[0]] : 2 === crList.length ? [crList[0], crList[1], crList[0], crList[1]] : (3 === crList.length && crList.push(0), crList);
@@ -16057,7 +16001,7 @@
16057
16001
  let roundCorner = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
16058
16002
  let edgeCb = arguments.length > 7 ? arguments[7] : undefined;
16059
16003
  let cornerRadius;
16060
- if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), 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)) {
16004
+ if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), 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)) {
16061
16005
  const cornerRadiusArr = rectCornerRadius;
16062
16006
  let cr0, cr1;
16063
16007
  switch (cornerRadiusArr.length) {
@@ -16333,9 +16277,6 @@
16333
16277
  init(contributions) {
16334
16278
  contributions && (this._renderContribitions = contributions.getContributions()), this._renderContribitions || (this._renderContribitions = []), this.builtinContributions || (this.builtinContributions = []), this.builtinContributions.push(defaultBaseClipRenderBeforeContribution), this.builtinContributions.push(defaultBaseClipRenderAfterContribution), this.builtinContributions.forEach(item => this._renderContribitions.push(item)), this._renderContribitions.length && (this._renderContribitions.sort((a, b) => b.order - a.order), this._beforeRenderContribitions = this._renderContribitions.filter(c => c.time === exports.BaseRenderContributionTime.beforeFillStroke), this._afterRenderContribitions = this._renderContribitions.filter(c => c.time === exports.BaseRenderContributionTime.afterFillStroke));
16335
16279
  }
16336
- reInit() {
16337
- this.init(this.graphicRenderContributions);
16338
- }
16339
16280
  beforeRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, params) {
16340
16281
  this._beforeRenderContribitions && this._beforeRenderContribitions.forEach(c => {
16341
16282
  if (c.supportedAppName && graphic.stage && graphic.stage.params && graphic.stage.params.context && graphic.stage.params.context.appName) {
@@ -16505,8 +16446,8 @@
16505
16446
  };
16506
16447
  };
16507
16448
  exports.DefaultCanvasArcRender = class DefaultCanvasArcRender extends BaseRender {
16508
- constructor(graphicRenderContributions) {
16509
- super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = ARC_NUMBER_TYPE, this.builtinContributions = [defaultArcRenderContribution, defaultArcBackgroundRenderContribution, defaultArcTextureRenderContribution], this.init(graphicRenderContributions);
16449
+ constructor(arcRenderContribitions) {
16450
+ super(), this.arcRenderContribitions = arcRenderContribitions, this.numberType = ARC_NUMBER_TYPE, this.builtinContributions = [defaultArcRenderContribution, defaultArcBackgroundRenderContribution, defaultArcTextureRenderContribution], this.init(arcRenderContribitions);
16510
16451
  }
16511
16452
  drawArcTailCapPath(arc, context, cx, cy, outerRadius, innerRadius, _sa, _ea) {
16512
16453
  const capAngle = _ea - _sa,
@@ -16681,8 +16622,8 @@
16681
16622
  };
16682
16623
  };
16683
16624
  exports.DefaultCanvasCircleRender = class DefaultCanvasCircleRender extends BaseRender {
16684
- constructor(graphicRenderContributions) {
16685
- super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = CIRCLE_NUMBER_TYPE, this.builtinContributions = [defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution], this.init(graphicRenderContributions);
16625
+ constructor(circleRenderContribitions) {
16626
+ super(), this.circleRenderContribitions = circleRenderContribitions, this.numberType = CIRCLE_NUMBER_TYPE, this.builtinContributions = [defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution], this.init(circleRenderContribitions);
16686
16627
  }
16687
16628
  drawShape(circle, context, x, y, drawContext, params, fillCb, strokeCb) {
16688
16629
  const circleAttribute = getTheme(circle, null == params ? void 0 : params.theme).circle,
@@ -17068,8 +17009,8 @@
17068
17009
  };
17069
17010
  };
17070
17011
  exports.DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
17071
- constructor(graphicRenderContributions) {
17072
- super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(graphicRenderContributions);
17012
+ constructor(areaRenderContribitions) {
17013
+ super(), this.areaRenderContribitions = areaRenderContribitions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(areaRenderContribitions);
17073
17014
  }
17074
17015
  drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
17075
17016
  var _a, _b, _c;
@@ -17312,8 +17253,8 @@
17312
17253
  };
17313
17254
  };
17314
17255
  exports.DefaultCanvasPathRender = class DefaultCanvasPathRender extends BaseRender {
17315
- constructor(graphicRenderContributions) {
17316
- super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = PATH_NUMBER_TYPE, this.builtinContributions = [defaultPathBackgroundRenderContribution, defaultPathTextureRenderContribution], this.init(graphicRenderContributions);
17256
+ constructor(pathRenderContribitions) {
17257
+ super(), this.pathRenderContribitions = pathRenderContribitions, this.numberType = PATH_NUMBER_TYPE, this.builtinContributions = [defaultPathBackgroundRenderContribution, defaultPathTextureRenderContribution], this.init(pathRenderContribitions);
17317
17258
  }
17318
17259
  drawShape(path, context, x, y, drawContext, params, fillCb, strokeCb) {
17319
17260
  var _a, _b, _c;
@@ -17368,8 +17309,8 @@
17368
17309
  };
17369
17310
  };
17370
17311
  exports.DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
17371
- constructor(graphicRenderContributions) {
17372
- super(), this.graphicRenderContributions = graphicRenderContributions, this.type = "rect", this.numberType = RECT_NUMBER_TYPE, this.builtinContributions = [defaultRectRenderContribution, defaultRectBackgroundRenderContribution, defaultRectTextureRenderContribution], this.init(graphicRenderContributions);
17312
+ constructor(rectRenderContribitions) {
17313
+ super(), this.rectRenderContribitions = rectRenderContribitions, this.type = "rect", this.numberType = RECT_NUMBER_TYPE, this.builtinContributions = [defaultRectRenderContribution, defaultRectBackgroundRenderContribution, defaultRectTextureRenderContribution], this.init(rectRenderContribitions);
17373
17314
  }
17374
17315
  drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
17375
17316
  var _a;
@@ -17440,8 +17381,8 @@
17440
17381
  };
17441
17382
  };
17442
17383
  exports.DefaultCanvasSymbolRender = class DefaultCanvasSymbolRender extends BaseRender {
17443
- constructor(graphicRenderContributions) {
17444
- super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = SYMBOL_NUMBER_TYPE, this.builtinContributions = [defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution, defaultSymbolClipRangeStrokeRenderContribution], this.init(graphicRenderContributions);
17384
+ constructor(symbolRenderContribitions) {
17385
+ super(), this.symbolRenderContribitions = symbolRenderContribitions, this.numberType = SYMBOL_NUMBER_TYPE, this.builtinContributions = [defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution, defaultSymbolClipRangeStrokeRenderContribution], this.init(symbolRenderContribitions);
17445
17386
  }
17446
17387
  drawShape(symbol, context, x, y, drawContext, params, fillCb, strokeCb) {
17447
17388
  var _a;
@@ -17612,8 +17553,8 @@
17612
17553
  };
17613
17554
  };
17614
17555
  exports.DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17615
- constructor(graphicRenderContributions) {
17616
- super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = TEXT_NUMBER_TYPE, this.builtinContributions = [defaultTextBackgroundRenderContribution], this.init(graphicRenderContributions);
17556
+ constructor(textRenderContribitions) {
17557
+ super(), this.textRenderContribitions = textRenderContribitions, this.numberType = TEXT_NUMBER_TYPE, this.builtinContributions = [defaultTextBackgroundRenderContribution], this.init(textRenderContribitions);
17617
17558
  }
17618
17559
  drawShape(text, context, x, y, drawContext, params, fillCb, strokeCb) {
17619
17560
  var _a, _b, _c;
@@ -17827,8 +17768,8 @@
17827
17768
  };
17828
17769
  };
17829
17770
  exports.DefaultCanvasPolygonRender = class DefaultCanvasPolygonRender extends BaseRender {
17830
- constructor(graphicRenderContributions) {
17831
- super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = POLYGON_NUMBER_TYPE, this.builtinContributions = [defaultPolygonBackgroundRenderContribution, defaultPolygonTextureRenderContribution], this.init(graphicRenderContributions);
17771
+ constructor(polygonRenderContribitions) {
17772
+ super(), this.polygonRenderContribitions = polygonRenderContribitions, this.numberType = POLYGON_NUMBER_TYPE, this.builtinContributions = [defaultPolygonBackgroundRenderContribution, defaultPolygonTextureRenderContribution], this.init(polygonRenderContribitions);
17832
17773
  }
17833
17774
  drawShape(polygon, context, x, y, drawContext, params, fillCb, strokeCb) {
17834
17775
  const polygonAttribute = getTheme(polygon, null == params ? void 0 : params.theme).polygon,
@@ -17883,9 +17824,6 @@
17883
17824
  constructor(groupRenderContribitions) {
17884
17825
  this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
17885
17826
  }
17886
- reInit() {
17887
- this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution);
17888
- }
17889
17827
  drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
17890
17828
  const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
17891
17829
  {
@@ -18016,8 +17954,8 @@
18016
17954
  };
18017
17955
  const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
18018
17956
  exports.DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender {
18019
- constructor(graphicRenderContributions) {
18020
- super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageRenderContribution, defaultImageBackgroundRenderContribution], this.init(graphicRenderContributions);
17957
+ constructor(imageRenderContribitions) {
17958
+ super(), this.imageRenderContribitions = imageRenderContribitions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageRenderContribution, defaultImageBackgroundRenderContribution], this.init(imageRenderContribitions);
18021
17959
  }
18022
17960
  drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) {
18023
17961
  const imageAttribute = getTheme(image).image,
@@ -18347,9 +18285,6 @@
18347
18285
  afterDraw(params) {
18348
18286
  this.drawContribution.afterDraw && this.drawContribution.afterDraw(this, Object.assign({}, this.drawParams));
18349
18287
  }
18350
- reInit() {
18351
- this.drawContribution.reInit();
18352
- }
18353
18288
  render(groups, params) {
18354
18289
  this.renderTreeRoots = groups, this.drawParams = params;
18355
18290
  const updateBounds = params.updateBounds;
@@ -18753,11 +18688,6 @@
18753
18688
  constructor(contributions, drawItemInterceptorContributions) {
18754
18689
  this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds(), this.backupDirtyBounds = new Bounds(), this.global = application.global, this.layerService = application.layerService, isArray$1(this.contributions) || (this.contributions = [this.contributions]), this.init();
18755
18690
  }
18756
- reInit() {
18757
- this.init(), this.contributions.forEach(item => {
18758
- item.reInit();
18759
- });
18760
- }
18761
18691
  init() {
18762
18692
  this.contributions.forEach(item => {
18763
18693
  if (item.style) {
@@ -19885,9 +19815,6 @@
19885
19815
  getPickerService() {
19886
19816
  return this.pickerService || (this.pickerService = container.get(PickerService)), this.pickerService;
19887
19817
  }
19888
- reInit() {
19889
- this.renderService.reInit(), this.pickerService.reInit();
19890
- }
19891
19818
  }
19892
19819
 
19893
19820
  function createStage(params) {
@@ -20485,9 +20412,6 @@
20485
20412
  constructor(pickItemInterceptorContributions, pickServiceInterceptorContributions) {
20486
20413
  this.pickItemInterceptorContributions = pickItemInterceptorContributions, this.pickServiceInterceptorContributions = pickServiceInterceptorContributions, this.type = "default", this.global = application.global;
20487
20414
  }
20488
- reInit() {
20489
- this._init();
20490
- }
20491
20415
  _init() {
20492
20416
  this.InterceptorContributions = this.pickItemInterceptorContributions.getContributions().sort((a, b) => a.order - b.order), this.pickerServiceInterceptorContributions = this.pickServiceInterceptorContributions.getContributions().sort((a, b) => a.order - b.order);
20493
20417
  }
@@ -20602,7 +20526,6 @@
20602
20526
  this.configure(global, env);
20603
20527
  }), this.configure(this.global, this.global.env);
20604
20528
  }
20605
- reInit() {}
20606
20529
  configure(global, env) {}
20607
20530
  pick(graphics, point, params) {
20608
20531
  let result = {
@@ -20675,62 +20598,6 @@
20675
20598
  return points = highestQuality ? points : simplifyRadialDist(points, void 0 !== tolerance ? tolerance * tolerance : 1);
20676
20599
  }
20677
20600
 
20678
- function isIdentityMatrix(matrix) {
20679
- return 1 === matrix.a && 0 === matrix.b && 0 === matrix.c && 1 === matrix.d && 0 === matrix.e && 0 === matrix.f;
20680
- }
20681
- function createEventTransformer(containerElement, getMatrix, getRect, transformPoint) {
20682
- return event => {
20683
- if (!(event instanceof MouseEvent || event instanceof TouchEvent || event instanceof PointerEvent)) return event;
20684
- const transformMatrix = getMatrix();
20685
- if (isIdentityMatrix(transformMatrix)) return event;
20686
- const containerRect = getRect(),
20687
- transformedEvent = new event.constructor(event.type, event);
20688
- if (Object.defineProperties(transformedEvent, {
20689
- target: {
20690
- value: event.target
20691
- },
20692
- currentTarget: {
20693
- value: event.currentTarget
20694
- }
20695
- }), event instanceof MouseEvent || event instanceof PointerEvent) transformPoint(event.clientX, event.clientY, transformMatrix, containerRect, transformedEvent);else if (event instanceof TouchEvent && event.touches.length > 0) {
20696
- const touch = event.touches[0];
20697
- transformPoint(touch.clientX, touch.clientY, transformMatrix, containerRect, transformedEvent);
20698
- }
20699
- return transformedEvent;
20700
- };
20701
- }
20702
- function createCanvasEventTransformer(canvasElement, getMatrix, getRect, transformPoint) {
20703
- return createEventTransformer(canvasElement.parentElement || canvasElement, getMatrix, getRect, transformPoint);
20704
- }
20705
- function registerWindowEventTransformer(window, container, getMatrix, getRect, transformPoint) {
20706
- const transformer = createEventTransformer(container, getMatrix, getRect, transformPoint);
20707
- window.setEventListenerTransformer(transformer);
20708
- }
20709
- function registerGlobalEventTransformer(global, container, getMatrix, getRect, transformPoint) {
20710
- const transformer = createEventTransformer(container, getMatrix, getRect, transformPoint);
20711
- global.setEventListenerTransformer(transformer);
20712
- }
20713
- function transformPointForCanvas(clientX, clientY, matrix, rect, transformedEvent) {
20714
- const transformedPoint = {
20715
- x: clientX,
20716
- y: clientY
20717
- };
20718
- matrix.transformPoint(transformedPoint, transformedPoint), Object.defineProperties(transformedEvent, {
20719
- _canvasX: {
20720
- value: transformedPoint.x
20721
- },
20722
- _canvasY: {
20723
- value: transformedPoint.y
20724
- }
20725
- });
20726
- }
20727
- function mapToCanvasPointForCanvas(nativeEvent) {
20728
- if (isNumber(nativeEvent._canvasX) && isNumber(nativeEvent._canvasY)) return {
20729
- x: nativeEvent._canvasX,
20730
- y: nativeEvent._canvasY
20731
- };
20732
- }
20733
-
20734
20601
  var __rest$1 = undefined && undefined.__rest || function (s, e) {
20735
20602
  var t = {};
20736
20603
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
@@ -21942,7 +21809,6 @@
21942
21809
  constructor() {
21943
21810
  this.numberType = GLYPH_NUMBER_TYPE;
21944
21811
  }
21945
- reInit() {}
21946
21812
  drawShape(glyph, context, x, y, drawContext, params, fillCb, strokeCb) {
21947
21813
  drawContext.drawContribution && glyph.getSubGraphic().forEach(item => {
21948
21814
  const renderer = drawContext.drawContribution.getRenderContribution(item);
@@ -24475,10 +24341,6 @@
24475
24341
  drawShape(graphic, ctx, x, y, drawContext, params, fillCb, strokeCb) {
24476
24342
  if (this.canvasRenderer.drawShape) return this.canvasRenderer.drawShape(graphic, ctx, x, y, drawContext, params, fillCb, strokeCb);
24477
24343
  }
24478
- reInit() {
24479
- var _a;
24480
- null === (_a = this.canvasRenderer) || void 0 === _a || _a.reInit();
24481
- }
24482
24344
  }
24483
24345
 
24484
24346
  var __decorate$18 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
@@ -27293,7 +27155,7 @@
27293
27155
  x += point.x, y += point.y, pickContext.setTransformForCurrent();
27294
27156
  } else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
27295
27157
  let picked = !0;
27296
- if (!onlyTranslate || rect.shadowRoot || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
27158
+ if (!onlyTranslate || rect.shadowRoot || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
27297
27159
  if (picked) return !0;
27298
27160
  const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
27299
27161
  pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
@@ -32033,7 +31895,7 @@
32033
31895
 
32034
31896
  const roughModule = _roughModule;
32035
31897
 
32036
- const version = "0.22.9-alpha.1";
31898
+ const version = "0.22.9";
32037
31899
  preLoadAllModule();
32038
31900
  if (isBrowserEnv()) {
32039
31901
  loadBrowserEnv(container);
@@ -32130,7 +31992,6 @@
32130
31992
  exports.ContainerModule = ContainerModule;
32131
31993
  exports.Context2dFactory = Context2dFactory;
32132
31994
  exports.ContributionProvider = ContributionProvider;
32133
- exports.ContributionStore = ContributionStore;
32134
31995
  exports.CurveContext = CurveContext;
32135
31996
  exports.CustomEvent = CustomEvent;
32136
31997
  exports.CustomPath2D = CustomPath2D;
@@ -32330,6 +32191,7 @@
32330
32191
  exports.StarRenderContribution = StarRenderContribution;
32331
32192
  exports.StaticLayerHandlerContribution = StaticLayerHandlerContribution;
32332
32193
  exports.Step = Step$1;
32194
+ exports.StepClosed = StepClosed;
32333
32195
  exports.StreamLight = StreamLight;
32334
32196
  exports.SubAnimate = SubAnimate;
32335
32197
  exports.Symbol = Symbol$1;
@@ -32420,11 +32282,9 @@
32420
32282
  exports.createArc = createArc;
32421
32283
  exports.createArc3d = createArc3d;
32422
32284
  exports.createArea = createArea;
32423
- exports.createCanvasEventTransformer = createCanvasEventTransformer;
32424
32285
  exports.createCircle = createCircle;
32425
32286
  exports.createColor = createColor;
32426
32287
  exports.createConicalGradient = createConicalGradient;
32427
- exports.createEventTransformer = createEventTransformer;
32428
32288
  exports.createGifImage = createGifImage;
32429
32289
  exports.createGlyph = createGlyph;
32430
32290
  exports.createGroup = createGroup;
@@ -32513,6 +32373,7 @@
32513
32373
  exports.genMonotoneYSegments = genMonotoneYSegments;
32514
32374
  exports.genMonotoneYTypeSegments = genMonotoneYTypeSegments;
32515
32375
  exports.genNumberType = genNumberType;
32376
+ exports.genStepClosedSegments = genStepClosedSegments;
32516
32377
  exports.genStepSegments = genStepSegments;
32517
32378
  exports.genStepTypeSegments = genStepTypeSegments;
32518
32379
  exports.generatorPathEasingFunc = generatorPathEasingFunc;
@@ -32583,7 +32444,6 @@
32583
32444
  exports.lottieCanvasPickModule = lottieCanvasPickModule;
32584
32445
  exports.lottieModule = lottieModule;
32585
32446
  exports.lynxEnvModule = lynxEnvModule;
32586
- exports.mapToCanvasPointForCanvas = mapToCanvasPointForCanvas;
32587
32447
  exports.mat3Tomat4 = mat3Tomat4;
32588
32448
  exports.mat4Allocate = mat4Allocate;
32589
32449
  exports.matrixAllocate = matrixAllocate;
@@ -32643,7 +32503,6 @@
32643
32503
  exports.registerFlexLayoutPlugin = registerFlexLayoutPlugin;
32644
32504
  exports.registerGifGraphic = registerGifGraphic;
32645
32505
  exports.registerGifImage = registerGifImage;
32646
- exports.registerGlobalEventTransformer = registerGlobalEventTransformer;
32647
32506
  exports.registerGlyph = registerGlyph;
32648
32507
  exports.registerGlyphGraphic = registerGlyphGraphic;
32649
32508
  exports.registerGroup = registerGroup;
@@ -32676,7 +32535,6 @@
32676
32535
  exports.registerText = registerText;
32677
32536
  exports.registerTextGraphic = registerTextGraphic;
32678
32537
  exports.registerViewTransform3dPlugin = registerViewTransform3dPlugin;
32679
- exports.registerWindowEventTransformer = registerWindowEventTransformer;
32680
32538
  exports.registerWrapText = registerWrapText;
32681
32539
  exports.registerWrapTextGraphic = registerWrapTextGraphic;
32682
32540
  exports.renderCommandList = renderCommandList;
@@ -32727,7 +32585,6 @@
32727
32585
  exports.textModule = textModule;
32728
32586
  exports.transformKeys = transformKeys;
32729
32587
  exports.transformMat4 = transformMat4;
32730
- exports.transformPointForCanvas = transformPointForCanvas;
32731
32588
  exports.transformUtil = transformUtil;
32732
32589
  exports.translate = translate;
32733
32590
  exports.ttEnvModule = ttEnvModule;