@visactor/vrender 0.21.0-alpha.1 → 0.21.0-alpha.11

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.es.js CHANGED
@@ -742,6 +742,13 @@ let DefaultGlobal = class {
742
742
  };
743
743
  DefaultGlobal = __decorate$1H([injectable(), __param$T(0, inject(ContributionProvider)), __param$T(0, named(EnvContribution)), __metadata$1h("design:paramtypes", [Object])], DefaultGlobal);
744
744
 
745
+ var MeasureModeEnum;
746
+ !function (MeasureModeEnum) {
747
+ MeasureModeEnum[MeasureModeEnum.estimate = 0] = "estimate", MeasureModeEnum[MeasureModeEnum.actualBounding = 1] = "actualBounding", MeasureModeEnum[MeasureModeEnum.fontBounding = 2] = "fontBounding";
748
+ }(MeasureModeEnum || (MeasureModeEnum = {}));
749
+
750
+ const strCommandMap = ["arc", "arcTo", "bezierCurveTo", "closePath", "ellipse", "lineTo", "moveTo", "quadraticCurveTo", "rect"];
751
+
745
752
  function getDefaultExportFromCjs (x) {
746
753
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
747
754
  }
@@ -1696,7 +1703,9 @@ class TextMeasure {
1696
1703
  } = this.textSpec;
1697
1704
  return {
1698
1705
  width: metrics.width,
1699
- height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize
1706
+ height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize,
1707
+ fontBoundingBoxAscent: metrics.fontBoundingBoxAscent,
1708
+ fontBoundingBoxDescent: metrics.fontBoundingBoxDescent
1700
1709
  };
1701
1710
  }
1702
1711
  quickMeasure(text) {
@@ -1710,7 +1719,7 @@ class TextMeasure {
1710
1719
  for (let i = 0; i < text.length; i++) {
1711
1720
  const char = text[i];
1712
1721
  let size = this._measureSpecialChar(char);
1713
- isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
1722
+ isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height), !isNil$1(size.fontBoundingBoxAscent) && (totalSize.fontBoundingBoxAscent = size.fontBoundingBoxAscent), !isNil$1(size.fontBoundingBoxDescent) && (totalSize.fontBoundingBoxDescent = size.fontBoundingBoxDescent);
1714
1723
  }
1715
1724
  return totalSize;
1716
1725
  }
@@ -1759,7 +1768,9 @@ class TextMeasure {
1759
1768
  const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
1760
1769
  this._numberCharSize = {
1761
1770
  width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
1762
- height: numberBounds.height
1771
+ height: numberBounds.height,
1772
+ fontBoundingBoxAscent: numberBounds.fontBoundingBoxAscent,
1773
+ fontBoundingBoxDescent: numberBounds.fontBoundingBoxDescent
1763
1774
  };
1764
1775
  }
1765
1776
  return this._numberCharSize;
@@ -1772,7 +1783,9 @@ class TextMeasure {
1772
1783
  const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
1773
1784
  this._letterCharSize = {
1774
1785
  width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
1775
- height: alphabetBounds.height
1786
+ height: alphabetBounds.height,
1787
+ fontBoundingBoxAscent: alphabetBounds.fontBoundingBoxAscent,
1788
+ fontBoundingBoxDescent: alphabetBounds.fontBoundingBoxDescent
1776
1789
  };
1777
1790
  }
1778
1791
  return this._letterCharSize;
@@ -2726,11 +2739,12 @@ function parseSvgPath(str) {
2726
2739
  for (let i = 0, len = paths.length; i < len; i++) if (currPath = paths[i], coordsStr = currPath.slice(1), commandChar = currPath[0], currCommandData = [commandChar], coordsStrArr = coordsStr.match(rePathCommand), null !== coordsStrArr) {
2727
2740
  for (let i = 0, len = coordsStrArr.length; i < len; i++) coordStr = coordsStrArr[i], coordNumber = parseFloat(coordStr), Number.isNaN(coordNumber) || currCommandData.push(coordNumber);
2728
2741
  if (standardCommandLen = commandLengths[commandChar], currCommandData.length - 1 > standardCommandLen) {
2729
- let subCommand;
2742
+ let subCommand,
2743
+ bestCommandChar = commandChar;
2730
2744
  for (let i = 1, len = currCommandData.length; i < len; i += standardCommandLen) {
2731
- subCommand = [commandChar];
2745
+ subCommand = [bestCommandChar];
2732
2746
  for (let j = i, subLen = i + standardCommandLen; j < subLen; j++) subCommand.push(currCommandData[j]);
2733
- result.push(subCommand);
2747
+ result.push(subCommand), "m" === bestCommandChar ? bestCommandChar = "l" : "M" === bestCommandChar && (bestCommandChar = "L");
2734
2748
  }
2735
2749
  } else result.push(currCommandData);
2736
2750
  } else result.push(currCommandData);
@@ -3912,6 +3926,7 @@ const DefaultStrokeStyle = Object.assign({
3912
3926
  const DefaultTextStyle = {
3913
3927
  text: "",
3914
3928
  maxLineWidth: 1 / 0,
3929
+ maxWidth: 1 / 0,
3915
3930
  textAlign: "left",
3916
3931
  textBaseline: "alphabetic",
3917
3932
  fontSize: 16,
@@ -3935,7 +3950,9 @@ const DefaultTextStyle = {
3935
3950
  suffixPosition: "end",
3936
3951
  underlineDash: [],
3937
3952
  underlineOffset: 0,
3938
- disableAutoClipedPoptip: void 0
3953
+ disableAutoClipedPoptip: void 0,
3954
+ measureMode: MeasureModeEnum.fontBounding,
3955
+ keepCenterInLine: !1
3939
3956
  };
3940
3957
  const DefaultPickStyle = {
3941
3958
  pickStrokeBuffer: 0
@@ -3979,6 +3996,7 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
3979
3996
  zIndex: 0,
3980
3997
  layout: null,
3981
3998
  boundsPadding: 0,
3999
+ fillStrokeOrder: 0,
3982
4000
  renderStyle: "default",
3983
4001
  pickMode: "accurate",
3984
4002
  customPickShape: null,
@@ -3988,7 +4006,8 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
3988
4006
  globalZIndex: 1,
3989
4007
  globalCompositeOperation: "",
3990
4008
  overflow: "hidden",
3991
- shadowPickMode: "graphic"
4009
+ shadowPickMode: "graphic",
4010
+ keepStrokeScale: !1
3992
4011
  }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
3993
4012
  function addAttributeToPrototype(obj, c, keys) {
3994
4013
  keys.forEach(key => {
@@ -4057,6 +4076,7 @@ const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, Defau
4057
4076
  });
4058
4077
  const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
4059
4078
  path: new CustomPath2D(),
4079
+ fillStrokeOrder: 1,
4060
4080
  customPath: () => {
4061
4081
  Logger.getInstance().warn("空函数");
4062
4082
  }
@@ -4262,10 +4282,32 @@ let ATextMeasure = class {
4262
4282
  configure(service, env) {
4263
4283
  this.canvas = service.canvas, this.context = service.context, service.bindTextMeasure(this);
4264
4284
  }
4265
- measureTextWidth(text, options) {
4266
- if (!this.context) return this.estimate(text, options).width;
4285
+ _measureTextWithoutAlignBaseline(text, options, compatible) {
4267
4286
  this.context.setTextStyleWithoutAlignBaseline(options);
4268
- return this.context.measureText(text).width;
4287
+ const metrics = this.context.measureText(text);
4288
+ return compatible ? this.compatibleMetrics(metrics, options) : metrics;
4289
+ }
4290
+ _measureTextWithAlignBaseline(text, options, compatible) {
4291
+ this.context.setTextStyle(options);
4292
+ const metrics = this.context.measureText(text);
4293
+ return compatible ? this.compatibleMetrics(metrics, options) : metrics;
4294
+ }
4295
+ compatibleMetrics(metrics, options) {
4296
+ if (null == metrics.actualBoundingBoxAscent || null == metrics.actualBoundingBoxDescent || null == metrics.fontBoundingBoxAscent || null == metrics.fontBoundingBoxDescent) {
4297
+ const {
4298
+ ascent: ascent,
4299
+ descent: descent
4300
+ } = this.measureTextBoundADscentEstimate(options);
4301
+ metrics.actualBoundingBoxAscent = ascent, metrics.actualBoundingBoxDescent = descent, metrics.fontBoundingBoxAscent = ascent, metrics.fontBoundingBoxDescent = descent;
4302
+ }
4303
+ if (null == metrics.actualBoundingBoxLeft || null == metrics.actualBoundingBoxRight) {
4304
+ const {
4305
+ left: left,
4306
+ right: right
4307
+ } = this.measureTextBoundLeftRightEstimate(options);
4308
+ metrics.actualBoundingBoxLeft = left, metrics.actualBoundingBoxRight = right;
4309
+ }
4310
+ return metrics;
4269
4311
  }
4270
4312
  estimate(text, _ref) {
4271
4313
  let {
@@ -4279,19 +4321,97 @@ let ATextMeasure = class {
4279
4321
  height: fontSize
4280
4322
  };
4281
4323
  }
4282
- measureTextPixelHeight(text, options) {
4324
+ measureTextWidth(text, options, textMeasure) {
4325
+ return this.context ? (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithoutAlignBaseline(text, options)).width : this.estimate(text, options).width;
4326
+ }
4327
+ measureTextBoundsWidth(text, options, textMeasure) {
4328
+ return this.context ? (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithoutAlignBaseline(text, options)).width : this.estimate(text, options).width;
4329
+ }
4330
+ measureTextBoundsLeftRight(text, options, textMeasure) {
4331
+ return this.context ? {
4332
+ left: (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithAlignBaseline(text, options, !0)).actualBoundingBoxLeft,
4333
+ right: textMeasure.actualBoundingBoxRight
4334
+ } : this.measureTextBoundLeftRightEstimate(options);
4335
+ }
4336
+ measureTextPixelHeight(text, options, textMeasure) {
4283
4337
  var _a;
4284
- if (!this.context) return null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize;
4285
- this.context.setTextStyleWithoutAlignBaseline(options);
4286
- const textMeasure = this.context.measureText(text);
4287
- return Math.abs(textMeasure.actualBoundingBoxAscent - textMeasure.actualBoundingBoxDescent);
4338
+ return this.context ? (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithoutAlignBaseline(text, options, !0), Math.abs(textMeasure.actualBoundingBoxAscent - textMeasure.actualBoundingBoxDescent)) : null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize;
4288
4339
  }
4289
- measureTextBoundHieght(text, options) {
4340
+ measureTextPixelADscent(text, options, textMeasure) {
4341
+ return this.context ? {
4342
+ ascent: (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithAlignBaseline(text, options, !0)).actualBoundingBoxAscent,
4343
+ descent: textMeasure.actualBoundingBoxDescent
4344
+ } : this.measureTextBoundADscentEstimate(options);
4345
+ }
4346
+ measureTextBoundHieght(text, options, textMeasure) {
4290
4347
  var _a;
4291
- if (!this.context) return null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize;
4292
- this.context.setTextStyleWithoutAlignBaseline(options);
4293
- const textMeasure = this.context.measureText(text);
4294
- return Math.abs(textMeasure.fontBoundingBoxAscent - textMeasure.fontBoundingBoxDescent);
4348
+ return this.context ? (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithoutAlignBaseline(text, options, !0), Math.abs(textMeasure.fontBoundingBoxAscent - textMeasure.fontBoundingBoxDescent)) : null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize;
4349
+ }
4350
+ measureTextBoundADscent(text, options, textMeasure) {
4351
+ return this.context ? {
4352
+ ascent: (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithAlignBaseline(text, options, !0)).fontBoundingBoxAscent,
4353
+ descent: textMeasure.fontBoundingBoxDescent
4354
+ } : this.measureTextBoundADscentEstimate(options);
4355
+ }
4356
+ measureTextBoundADscentEstimate(options) {
4357
+ var _a;
4358
+ const fontSize = null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize;
4359
+ return {
4360
+ ascent: .79 * fontSize,
4361
+ descent: .21 * fontSize
4362
+ };
4363
+ }
4364
+ measureTextBoundLeftRightEstimate(options) {
4365
+ var _a;
4366
+ const fontSize = null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize,
4367
+ {
4368
+ textAlign: textAlign
4369
+ } = options;
4370
+ return "center" === textAlign ? {
4371
+ left: fontSize / 2,
4372
+ right: fontSize / 2
4373
+ } : "right" === textAlign || "end" === textAlign ? {
4374
+ left: fontSize,
4375
+ right: 0
4376
+ } : {
4377
+ left: 0,
4378
+ right: fontSize
4379
+ };
4380
+ }
4381
+ measureTextPixelADscentAndWidth(text, options, mode) {
4382
+ if (!this.context) return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), {
4383
+ width: this.estimate(text, options).width
4384
+ });
4385
+ const out = this._measureTextWithoutAlignBaseline(text, options, !0);
4386
+ if (mode === MeasureModeEnum.actualBounding) return {
4387
+ ascent: out.actualBoundingBoxAscent,
4388
+ descent: out.actualBoundingBoxDescent,
4389
+ width: out.width
4390
+ };
4391
+ if (mode === MeasureModeEnum.estimate) return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), {
4392
+ width: out.width
4393
+ });
4394
+ if (mode === MeasureModeEnum.fontBounding) {
4395
+ let ascent = out.fontBoundingBoxAscent,
4396
+ descent = out.fontBoundingBoxDescent;
4397
+ if (out.actualBoundingBoxDescent && descent < out.actualBoundingBoxDescent) {
4398
+ const delta = out.actualBoundingBoxDescent - descent;
4399
+ descent += delta, ascent -= delta;
4400
+ } else if (out.actualBoundingBoxAscent && ascent < out.actualBoundingBoxAscent) {
4401
+ const delta = out.actualBoundingBoxAscent - ascent;
4402
+ ascent += delta, descent -= delta;
4403
+ }
4404
+ return {
4405
+ ascent: ascent,
4406
+ descent: descent,
4407
+ width: out.width
4408
+ };
4409
+ }
4410
+ return {
4411
+ ascent: out.actualBoundingBoxAscent,
4412
+ descent: out.actualBoundingBoxDescent,
4413
+ width: out.width
4414
+ };
4295
4415
  }
4296
4416
  measureText(text, options) {
4297
4417
  return this.context ? (this.context.setTextStyleWithoutAlignBaseline(options), this.context.measureText(text)) : this.estimate(text, options);
@@ -4369,6 +4489,14 @@ let ATextMeasure = class {
4369
4489
  return data;
4370
4490
  }
4371
4491
  _clipTextEnd(text, options, width, leftIdx, rightIdx) {
4492
+ if (leftIdx === rightIdx) {
4493
+ Logger.getInstance().warn(`【_clipTextEnd】不应该走到这里${text}, ${leftIdx}, ${rightIdx}`);
4494
+ const subText = text.substring(0, rightIdx + 1);
4495
+ return {
4496
+ str: subText,
4497
+ width: this.measureTextWidth(subText, options)
4498
+ };
4499
+ }
4372
4500
  const middleIdx = Math.floor((leftIdx + rightIdx) / 2),
4373
4501
  subText = text.substring(0, middleIdx + 1),
4374
4502
  strWidth = this.measureTextWidth(subText, options);
@@ -4402,7 +4530,7 @@ let ATextMeasure = class {
4402
4530
  }
4403
4531
  _clipTextStart(text, options, width, leftIdx, rightIdx) {
4404
4532
  const middleIdx = Math.ceil((leftIdx + rightIdx) / 2),
4405
- subText = text.substring(middleIdx - 1, text.length - 1),
4533
+ subText = text.substring(middleIdx - 1, text.length),
4406
4534
  strWidth = this.measureTextWidth(subText, options);
4407
4535
  let length;
4408
4536
  if (strWidth > width) {
@@ -4410,18 +4538,18 @@ let ATextMeasure = class {
4410
4538
  str: "",
4411
4539
  width: 0
4412
4540
  };
4413
- const str = text.substring(middleIdx, text.length - 1);
4541
+ const str = text.substring(middleIdx, text.length);
4414
4542
  return length = this.measureTextWidth(str, options), length <= width ? {
4415
4543
  str: str,
4416
4544
  width: length
4417
- } : this._clipTextStart(text, options, width, middleIdx, text.length - 1);
4545
+ } : this._clipTextStart(text, options, width, middleIdx, text.length);
4418
4546
  }
4419
4547
  if (strWidth < width) {
4420
4548
  if (middleIdx <= 0) return {
4421
4549
  str: text,
4422
4550
  width: this.measureTextWidth(text, options)
4423
4551
  };
4424
- const str = text.substring(middleIdx - 2, text.length - 1);
4552
+ const str = text.substring(middleIdx - 2, text.length);
4425
4553
  return length = this.measureTextWidth(str, options), length >= width ? {
4426
4554
  str: subText,
4427
4555
  width: strWidth
@@ -5082,7 +5210,7 @@ let DefaultWindow = class {
5082
5210
  }
5083
5211
  hasSubView() {
5084
5212
  const viewBox = this._handler.getViewBox();
5085
- return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width === viewBox.width() && this.height === viewBox.height());
5213
+ return !(0 === viewBox.x1 && 0 === viewBox.y1 && isNumberClose(this.width, viewBox.width()) && isNumberClose(this.height, viewBox.height()));
5086
5214
  }
5087
5215
  isVisible(bbox) {
5088
5216
  return this._handler.isVisible(bbox);
@@ -6006,7 +6134,7 @@ class EventManager {
6006
6134
  timeStamp: now
6007
6135
  });
6008
6136
  const clickHistory = trackingData.clicksByButton[from.button];
6009
- clickHistory.target === clickEvent.target && now - clickHistory.timeStamp < (null !== (_a = this._config.clickInterval) && void 0 !== _a ? _a : 200) ? ++clickHistory.clickCount : clickHistory.clickCount = 1, clickHistory.target = clickEvent.target, clickHistory.timeStamp = now, clickEvent.detail = clickHistory.clickCount, isMouseLike(clickEvent.pointerType) ? (this.dispatchEvent(clickEvent, "click"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dblclick")) : "touch" === clickEvent.pointerType && (this.dispatchEvent(clickEvent, "tap"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dbltap")), this.dispatchEvent(clickEvent, "pointertap"), this.freeEvent(clickEvent);
6137
+ clickHistory.target === clickEvent.target && now - clickHistory.timeStamp < (null !== (_a = this._config.clickInterval) && void 0 !== _a ? _a : 200) ? ++clickHistory.clickCount : clickHistory.clickCount = 1, clickHistory.target = clickEvent.target, clickHistory.timeStamp = now, clickEvent.detail = clickHistory.clickCount, isMouseLike(clickEvent.pointerType) ? (this.dispatchEvent(clickEvent, "click"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dblclick")) : "touch" === clickEvent.pointerType && this._config.supportsTouchEvents && (this.dispatchEvent(clickEvent, "tap"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dbltap")), this.dispatchEvent(clickEvent, "pointertap"), this.freeEvent(clickEvent);
6010
6138
  }
6011
6139
  this.freeEvent(e);
6012
6140
  }, this.onPointerUpOutside = (from, target) => {
@@ -6223,7 +6351,8 @@ class EventSystem {
6223
6351
  supportsPointerEvents = global.supportsPointerEvents
6224
6352
  } = params;
6225
6353
  this.manager = new EventManager(rootNode, {
6226
- clickInterval: clickInterval
6354
+ clickInterval: clickInterval,
6355
+ supportsTouchEvents: supportsTouchEvents
6227
6356
  }), 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 = {
6228
6357
  default: "inherit",
6229
6358
  pointer: "pointer"
@@ -6394,7 +6523,7 @@ class TimeOutTickHandler {
6394
6523
  }
6395
6524
  }
6396
6525
 
6397
- class DefaultTicker {
6526
+ class DefaultTicker extends EventEmitter {
6398
6527
  set mode(m) {
6399
6528
  this._mode !== m && (this._mode = m, this.setupTickHandler());
6400
6529
  }
@@ -6403,17 +6532,17 @@ class DefaultTicker {
6403
6532
  }
6404
6533
  constructor() {
6405
6534
  let timelines = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6406
- this.handleTick = (handler, params) => {
6535
+ super(), this.handleTick = (handler, params) => {
6407
6536
  const {
6408
6537
  once = !1
6409
6538
  } = null != params ? params : {};
6410
- this.ifCanStop() ? this.stop() : (this._handlerTick(handler), once || handler.tick(this.interval, this.handleTick));
6411
- }, this._handlerTick = handler => {
6539
+ this.ifCanStop() ? this.stop() : (this._handlerTick(), once || handler.tick(this.interval, this.handleTick));
6540
+ }, this._handlerTick = () => {
6412
6541
  const time = this.tickerHandler.getTime();
6413
6542
  let delta = 0;
6414
6543
  this.lastFrameTime >= 0 && (delta = time - this.lastFrameTime), this.lastFrameTime = time, this.status === STATUS$1.RUNNING && (this.tickCounts++, this.timelines.forEach(t => {
6415
6544
  t.tick(delta);
6416
- }));
6545
+ }), this.emit("afterTick"));
6417
6546
  }, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.timelines = timelines, this.autoStop = !0;
6418
6547
  }
6419
6548
  init() {
@@ -6509,6 +6638,9 @@ class DefaultTicker {
6509
6638
  stop() {
6510
6639
  this.status = STATUS$1.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
6511
6640
  }
6641
+ trySyncTickStatus() {
6642
+ this.status === STATUS$1.RUNNING && this._handlerTick();
6643
+ }
6512
6644
  }
6513
6645
 
6514
6646
  class ManualTickHandler {
@@ -7650,7 +7782,7 @@ class TagPointsUpdate extends ACustomAnimate {
7650
7782
  lastMatchedIndex = i, lastMatchedPoint = tagMap.get(this.toPoints[i].context);
7651
7783
  break;
7652
7784
  }
7653
- "clip" === this.newPointAnimateType && 0 !== this.toPoints.length && (Number.isFinite(lastMatchedIndex) ? (this.clipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension], isValidNumber$1(this.clipRange) ? this.clipRange = clamp$1(this.clipRange, 0, 1) : this.clipRange = 0) : this.clipRange = 0);
7785
+ "clip" === this.newPointAnimateType && 0 !== this.toPoints.length && (Number.isFinite(lastMatchedIndex) ? (this.clipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension], 1 === this.clipRange && (this.shrinkClipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension]), isValidNumber$1(this.clipRange) ? this.clipRange = clamp$1(this.clipRange, 0, 1) : this.clipRange = 0) : this.clipRange = 0);
7654
7786
  let prevMatchedPoint = this.toPoints[0];
7655
7787
  this.interpolatePoints = this.toPoints.map((point, index) => {
7656
7788
  const matchedPoint = tagMap.get(point.context);
@@ -7662,11 +7794,19 @@ class TagPointsUpdate extends ACustomAnimate {
7662
7794
  return newPoint.defined = toPoint.defined, newPoint.context = toPoint.context, newPoint;
7663
7795
  });
7664
7796
  }
7797
+ onFirstRun() {
7798
+ const lastClipRange = this.target.attribute.clipRange;
7799
+ isValidNumber$1(lastClipRange * this.clipRange) && (this.clipRange *= lastClipRange);
7800
+ }
7665
7801
  onUpdate(end, ratio, out) {
7666
7802
  if (this.points = this.points.map((point, index) => {
7667
7803
  const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
7668
7804
  return newPoint.context = point.context, newPoint;
7669
- }), this.clipRange && (out.clipRange = this.clipRange + (1 - this.clipRange) * ratio), this.segmentsCache && this.to.segments) {
7805
+ }), this.clipRange) {
7806
+ if (this.shrinkClipRange) return void (end ? (out.points = this.toPoints, out.clipRange = 1) : (out.points = this.fromPoints, out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio));
7807
+ out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
7808
+ }
7809
+ if (this.segmentsCache && this.to.segments) {
7670
7810
  let start = 0;
7671
7811
  out.segments = this.to.segments.map((segment, index) => {
7672
7812
  const end = start + this.segmentsCache[index],
@@ -12020,7 +12160,8 @@ class DefaultArcRenderContribution {
12020
12160
  x: originX = arcAttribute.x,
12021
12161
  y: originY = arcAttribute.y,
12022
12162
  scaleX = arcAttribute.scaleX,
12023
- scaleY = arcAttribute.scaleY
12163
+ scaleY = arcAttribute.scaleY,
12164
+ keepStrokeScale = arcAttribute.keepStrokeScale
12024
12165
  } = arc.attribute;
12025
12166
  let {
12026
12167
  innerRadius = arcAttribute.innerRadius,
@@ -12032,7 +12173,7 @@ class DefaultArcRenderContribution {
12032
12173
  {
12033
12174
  distance = arcAttribute[key].distance
12034
12175
  } = borderStyle,
12035
- d = getScaledStroke(context, distance, context.dpr),
12176
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12036
12177
  deltaAngle = distance / outerRadius,
12037
12178
  sign = "outerBorder" === key ? 1 : -1;
12038
12179
  if (arc.setAttributes({
@@ -12077,14 +12218,15 @@ class DefaultCircleRenderContribution {
12077
12218
  x: originX = circleAttribute.x,
12078
12219
  y: originY = circleAttribute.y,
12079
12220
  scaleX = circleAttribute.scaleX,
12080
- scaleY = circleAttribute.scaleY
12221
+ scaleY = circleAttribute.scaleY,
12222
+ keepStrokeScale = circleAttribute.keepStrokeScale
12081
12223
  } = circle.attribute,
12082
12224
  renderBorder = (borderStyle, key) => {
12083
12225
  const doStroke = !(!borderStyle || !borderStyle.stroke),
12084
12226
  {
12085
12227
  distance = circleAttribute[key].distance
12086
12228
  } = borderStyle,
12087
- d = getScaledStroke(context, distance, context.dpr),
12229
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12088
12230
  sign = "outerBorder" === key ? 1 : -1;
12089
12231
  if (context.beginPath(), context.arc(x, y, radius + sign * d, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), strokeCb) strokeCb(context, borderStyle, circleAttribute[key]);else if (doStroke) {
12090
12232
  const lastOpacity = circleAttribute[key].opacity;
@@ -12203,7 +12345,8 @@ class DefaultRectRenderContribution {
12203
12345
  scaleX = rectAttribute.scaleX,
12204
12346
  scaleY = rectAttribute.scaleY,
12205
12347
  x1: x1,
12206
- y1: y1
12348
+ y1: y1,
12349
+ keepStrokeScale = rectAttribute.keepStrokeScale
12207
12350
  } = rect.attribute;
12208
12351
  let {
12209
12352
  width: width,
@@ -12216,7 +12359,7 @@ class DefaultRectRenderContribution {
12216
12359
  {
12217
12360
  distance = rectAttribute[key].distance
12218
12361
  } = borderStyle,
12219
- d = getScaledStroke(context, distance, context.dpr),
12362
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12220
12363
  nextX = x + sign * d,
12221
12364
  nextY = y + sign * d,
12222
12365
  dw = 2 * d;
@@ -12373,14 +12516,15 @@ class DefaultSymbolRenderContribution {
12373
12516
  x: originX = symbolAttribute.x,
12374
12517
  y: originY = symbolAttribute.y,
12375
12518
  scaleX = symbolAttribute.scaleX,
12376
- scaleY = symbolAttribute.scaleY
12519
+ scaleY = symbolAttribute.scaleY,
12520
+ keepStrokeScale = symbolAttribute.keepStrokeScale
12377
12521
  } = symbol.attribute,
12378
12522
  renderBorder = (borderStyle, key) => {
12379
12523
  const doStroke = !(!borderStyle || !borderStyle.stroke),
12380
12524
  {
12381
12525
  distance = symbolAttribute[key].distance
12382
12526
  } = borderStyle,
12383
- d = getScaledStroke(context, distance, context.dpr),
12527
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12384
12528
  sign = "outerBorder" === key ? 1 : -1;
12385
12529
  if (context.beginPath(), !1 === parsedPath.drawOffset(context, size, x, y, sign * d) && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), strokeCb) strokeCb(context, borderStyle, symbolAttribute[key]);else if (doStroke) {
12386
12530
  const lastOpacity = symbolAttribute[key].opacity;
@@ -12500,7 +12644,8 @@ let DefaultCanvasArcRender = class extends BaseRender {
12500
12644
  fill = arcAttribute.fill,
12501
12645
  stroke = arcAttribute.stroke,
12502
12646
  x: originX = arcAttribute.x,
12503
- y: originY = arcAttribute.y
12647
+ y: originY = arcAttribute.y,
12648
+ fillStrokeOrder = arcAttribute.fillStrokeOrder
12504
12649
  } = arc.attribute,
12505
12650
  data = this.valid(arc, arcAttribute, fillCb, strokeCb);
12506
12651
  if (!data) return;
@@ -12536,7 +12681,17 @@ let DefaultCanvasArcRender = class extends BaseRender {
12536
12681
  isFullStroke: isFullStroke,
12537
12682
  stroke: arrayStroke
12538
12683
  } = parseStroke(stroke);
12539
- if ((doFill || isFullStroke) && (context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), beforeRenderContribitionsRuned = !0, context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill())), doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.stroke()))), !isFullStroke && doStroke) {
12684
+ if (doFill || isFullStroke) {
12685
+ context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), beforeRenderContribitionsRuned = !0, context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
12686
+ const _runFill = () => {
12687
+ doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill()));
12688
+ },
12689
+ _runStroke = () => {
12690
+ doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.stroke()));
12691
+ };
12692
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
12693
+ }
12694
+ if (!isFullStroke && doStroke) {
12540
12695
  context.beginPath();
12541
12696
  drawArcPath$1(arc, context, x, y, outerRadius, innerRadius, arrayStroke);
12542
12697
  beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke());
@@ -12554,14 +12709,20 @@ let DefaultCanvasArcRender = class extends BaseRender {
12554
12709
  fill = arcAttribute.fill
12555
12710
  } = arc.attribute,
12556
12711
  startAngle = endAngle;
12557
- if (this.drawArcTailCapPath(arc, context, x, y, outerRadius, innerRadius, startAngle, startAngle + capAngle), beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), doFill) {
12558
- const color = fill;
12559
- if ("conical" === color.gradient) {
12560
- const lastColor = getConicGradientAt(0, 0, endAngle, color);
12561
- fillCb || fillVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = lastColor, context.fill());
12562
- }
12563
- }
12564
- doStroke && (strokeCb || sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()));
12712
+ this.drawArcTailCapPath(arc, context, x, y, outerRadius, innerRadius, startAngle, startAngle + capAngle), beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
12713
+ const _runFill = () => {
12714
+ if (doFill) {
12715
+ const color = fill;
12716
+ if ("conical" === color.gradient) {
12717
+ const lastColor = getConicGradientAt(0, 0, endAngle, color);
12718
+ fillCb || fillVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = lastColor, context.fill());
12719
+ }
12720
+ }
12721
+ },
12722
+ _runStroke = () => {
12723
+ doStroke && (strokeCb || sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()));
12724
+ };
12725
+ _runFill(), _runStroke();
12565
12726
  }
12566
12727
  }
12567
12728
  this.afterRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), tempChangeConicalColor && (fill.startAngle += conicalOffset, fill.endAngle += conicalOffset);
@@ -12599,7 +12760,8 @@ let DefaultCanvasCircleRender = class extends BaseRender {
12599
12760
  startAngle = circleAttribute.startAngle,
12600
12761
  endAngle = circleAttribute.endAngle,
12601
12762
  x: originX = circleAttribute.x,
12602
- y: originY = circleAttribute.y
12763
+ y: originY = circleAttribute.y,
12764
+ fillStrokeOrder = circleAttribute.fillStrokeOrder
12603
12765
  } = circle.attribute,
12604
12766
  data = this.valid(circle, circleAttribute, fillCb, strokeCb);
12605
12767
  if (!data) return;
@@ -12609,7 +12771,14 @@ let DefaultCanvasCircleRender = class extends BaseRender {
12609
12771
  doFill: doFill,
12610
12772
  doStroke: doStroke
12611
12773
  } = data;
12612
- context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb), doFill && (fillCb ? fillCb(context, circle.attribute, circleAttribute) : fVisible && (context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.fill())), doStroke && (strokeCb ? strokeCb(context, circle.attribute, circleAttribute) : sVisible && (context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.stroke())), this.afterRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
12774
+ context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
12775
+ const _runFill = () => {
12776
+ doFill && (fillCb ? fillCb(context, circle.attribute, circleAttribute) : fVisible && (context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.fill()));
12777
+ },
12778
+ _runStroke = () => {
12779
+ doStroke && (strokeCb ? strokeCb(context, circle.attribute, circleAttribute) : sVisible && (context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.stroke()));
12780
+ };
12781
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
12613
12782
  }
12614
12783
  draw(circle, renderService, drawContext, params) {
12615
12784
  const circleAttribute = getTheme(circle, null == params ? void 0 : params.theme).circle;
@@ -13050,7 +13219,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13050
13219
  super(), this.areaRenderContribitions = areaRenderContribitions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(areaRenderContribitions);
13051
13220
  }
13052
13221
  drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
13053
- var _a, _b, _c, _d, _e;
13222
+ var _a, _b, _c;
13054
13223
  const {
13055
13224
  points: points
13056
13225
  } = area.attribute;
@@ -13074,28 +13243,31 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13074
13243
  x: originX = 0,
13075
13244
  x: originY = 0
13076
13245
  } = area.attribute;
13077
- if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
13246
+ !1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
13078
13247
  attribute: area.attribute
13079
- }), stroke) {
13080
- const {
13081
- stroke = areaAttribute && areaAttribute.stroke
13082
- } = area.attribute;
13083
- if (isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
13084
- context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
13085
- for (let i = 1; i < points.length; i++) {
13086
- const p = points[i];
13087
- context.lineTo(p.x + offsetX, p.y + offsetY, z);
13088
- }
13089
- } else if (stroke[2]) {
13090
- const endP = points[points.length - 1];
13091
- context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
13092
- for (let i = points.length - 2; i >= 0; i--) {
13093
- const p = points[i];
13094
- context.lineTo((null !== (_d = p.x1) && void 0 !== _d ? _d : p.x) + offsetX, (null !== (_e = p.y1) && void 0 !== _e ? _e : p.y) + offsetY, z);
13248
+ }), (() => {
13249
+ var _a, _b;
13250
+ if (stroke) {
13251
+ const {
13252
+ stroke = areaAttribute && areaAttribute.stroke
13253
+ } = area.attribute;
13254
+ if (isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
13255
+ context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
13256
+ for (let i = 1; i < points.length; i++) {
13257
+ const p = points[i];
13258
+ context.lineTo(p.x + offsetX, p.y + offsetY, z);
13259
+ }
13260
+ } else if (stroke[2]) {
13261
+ const endP = points[points.length - 1];
13262
+ context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
13263
+ for (let i = points.length - 2; i >= 0; i--) {
13264
+ const p = points[i];
13265
+ context.lineTo((null !== (_a = p.x1) && void 0 !== _a ? _a : p.x) + offsetX, (null !== (_b = p.y1) && void 0 !== _b ? _b : p.y) + offsetY, z);
13266
+ }
13095
13267
  }
13268
+ strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
13096
13269
  }
13097
- strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
13098
- }
13270
+ })();
13099
13271
  }
13100
13272
  drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
13101
13273
  var _a, _b, _c, _d, _e, _f;
@@ -13260,23 +13432,24 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13260
13432
  x: originX = 0,
13261
13433
  x: originY = 0
13262
13434
  } = attribute;
13263
- if (!1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
13435
+ return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
13264
13436
  attribute: attribute
13265
- }), !1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
13266
- const {
13267
- stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
13268
- } = attribute;
13269
- isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? "x" : "y", {
13270
- offsetX: offsetX,
13271
- offsetY: offsetY,
13272
- offsetZ: offsetZ,
13273
- drawConnect: connect,
13274
- mode: connectedType,
13275
- zeroX: connectedX,
13276
- zeroY: connectedY
13277
- })), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
13278
- }
13279
- return !1;
13437
+ }), (() => {
13438
+ if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
13439
+ const {
13440
+ stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
13441
+ } = attribute;
13442
+ isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? "x" : "y", {
13443
+ offsetX: offsetX,
13444
+ offsetY: offsetY,
13445
+ offsetZ: offsetZ,
13446
+ drawConnect: connect,
13447
+ mode: connectedType,
13448
+ zeroX: connectedX,
13449
+ zeroY: connectedY
13450
+ })), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
13451
+ }
13452
+ })(), !1;
13280
13453
  }
13281
13454
  };
13282
13455
  DefaultCanvasAreaRender = __decorate$1v([injectable(), __param$N(0, inject(ContributionProvider)), __param$N(0, named(AreaRenderContribution)), __metadata$19("design:paramtypes", [Object])], DefaultCanvasAreaRender);
@@ -13308,7 +13481,8 @@ let DefaultCanvasPathRender = class extends BaseRender {
13308
13481
  const pathAttribute = null !== (_a = this.tempTheme) && void 0 !== _a ? _a : getTheme(path, null == params ? void 0 : params.theme).path,
13309
13482
  {
13310
13483
  x: originX = pathAttribute.x,
13311
- y: originY = pathAttribute.y
13484
+ y: originY = pathAttribute.y,
13485
+ fillStrokeOrder = pathAttribute.fillStrokeOrder
13312
13486
  } = path.attribute,
13313
13487
  z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
13314
13488
  data = this.valid(path, pathAttribute, fillCb, strokeCb);
@@ -13323,7 +13497,14 @@ let DefaultCanvasPathRender = class extends BaseRender {
13323
13497
  const path2D = null !== (_c = path.attribute.path) && void 0 !== _c ? _c : pathAttribute.path;
13324
13498
  renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
13325
13499
  }
13326
- context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb), doStroke && (strokeCb ? strokeCb(context, path.attribute, pathAttribute) : sVisible && (context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.stroke())), doFill && (fillCb ? fillCb(context, path.attribute, pathAttribute) : fVisible && (context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.fill())), this.afterRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
13500
+ context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
13501
+ const _runStroke = () => {
13502
+ doStroke && (strokeCb ? strokeCb(context, path.attribute, pathAttribute) : sVisible && (context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.stroke()));
13503
+ },
13504
+ _runFill = () => {
13505
+ doFill && (fillCb ? fillCb(context, path.attribute, pathAttribute) : fVisible && (context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.fill()));
13506
+ };
13507
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
13327
13508
  }
13328
13509
  draw(path, renderService, drawContext, params) {
13329
13510
  const pathAttribute = getTheme(path, null == params ? void 0 : params.theme).path;
@@ -13367,7 +13548,8 @@ let DefaultCanvasRectRender = class extends BaseRender {
13367
13548
  x1: x1,
13368
13549
  y1: y1,
13369
13550
  x: originX = rectAttribute.x,
13370
- y: originY = rectAttribute.y
13551
+ y: originY = rectAttribute.y,
13552
+ fillStrokeOrder = rectAttribute.fillStrokeOrder
13371
13553
  } = rect.attribute;
13372
13554
  let {
13373
13555
  width: width,
@@ -13386,7 +13568,14 @@ let DefaultCanvasRectRender = class extends BaseRender {
13386
13568
  doFill: doFill,
13387
13569
  doStroke: doStroke
13388
13570
  };
13389
- context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke), doFillOrStroke.doFill && (fillCb ? fillCb(context, rect.attribute, rectAttribute) : fVisible && (context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.fill())), doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, rect.attribute, rectAttribute) : sVisible && (context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.stroke())), this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
13571
+ context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
13572
+ const _runFill = () => {
13573
+ doFillOrStroke.doFill && (fillCb ? fillCb(context, rect.attribute, rectAttribute) : fVisible && (context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.fill()));
13574
+ },
13575
+ _runStroke = () => {
13576
+ doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, rect.attribute, rectAttribute) : sVisible && (context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.stroke()));
13577
+ };
13578
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
13390
13579
  }
13391
13580
  draw(rect, renderService, drawContext, params) {
13392
13581
  const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect;
@@ -13422,7 +13611,8 @@ let DefaultCanvasSymbolRender = class extends BaseRender {
13422
13611
  x: originX = symbolAttribute.x,
13423
13612
  y: originY = symbolAttribute.y,
13424
13613
  scaleX = symbolAttribute.scaleX,
13425
- scaleY = symbolAttribute.scaleY
13614
+ scaleY = symbolAttribute.scaleY,
13615
+ fillStrokeOrder = symbolAttribute.fillStrokeOrder
13426
13616
  } = symbol.attribute,
13427
13617
  data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);
13428
13618
  if (!data) return;
@@ -13445,14 +13635,27 @@ let DefaultCanvasSymbolRender = class extends BaseRender {
13445
13635
  const obj = Object.assign({}, a);
13446
13636
  obj.fill = null !== (_a = a.fill) && void 0 !== _a ? _a : symbol.attribute.fill, obj.opacity = null !== (_b = a.opacity) && void 0 !== _b ? _b : symbol.attribute.opacity, obj.fillOpacity = symbol.attribute.fillOpacity, obj.stroke = null !== (_c = a.stroke) && void 0 !== _c ? _c : symbol.attribute.stroke, a = obj;
13447
13637
  }
13448
- a.fill && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : (context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute), context.fill())), a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
13638
+ const _runFill = () => {
13639
+ a.fill && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : (context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute), context.fill()));
13640
+ },
13641
+ _runStroke = () => {
13642
+ a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
13643
+ };
13644
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
13449
13645
  };
13450
13646
  if (keepDirIn3d && context.camera && context.project) {
13451
13647
  const p = context.project(x, y, z),
13452
13648
  camera = context.camera;
13453
13649
  context.camera = null, !1 === parsedPath.draw(context, isArray$1(size) ? [size[0] * scaleX, size[1] * scaleY] : size * scaleX, p.x, p.y, void 0, callback) && context.closePath(), context.camera = camera;
13454
13650
  } else !1 === parsedPath.draw(context, size, x, y, z, callback) && context.closePath();
13455
- context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb), doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill())), doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke())), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
13651
+ context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
13652
+ const _runFill = () => {
13653
+ doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill()));
13654
+ },
13655
+ _runStroke = () => {
13656
+ doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
13657
+ };
13658
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
13456
13659
  }
13457
13660
  draw(symbol, renderService, drawContext, params) {
13458
13661
  const symbolAttribute = getTheme(symbol, null == params ? void 0 : params.theme).symbol;
@@ -13599,16 +13802,8 @@ let DefaultCanvasTextRender = class extends BaseRender {
13599
13802
  verticalMode = textAttribute.verticalMode,
13600
13803
  x: originX = textAttribute.x,
13601
13804
  y: originY = textAttribute.y
13602
- } = text.attribute;
13603
- let {
13604
- textAlign = textAttribute.textAlign,
13605
- textBaseline = textAttribute.textBaseline
13606
- } = text.attribute;
13607
- if (!verticalMode && "vertical" === direction) {
13608
- const t = textAlign;
13609
- textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
13610
- }
13611
- const lineHeight = null !== (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _c ? _c : fontSize,
13805
+ } = text.attribute,
13806
+ lineHeight = null !== (_a = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _a ? _a : fontSize,
13612
13807
  data = this.valid(text, textAttribute, fillCb, strokeCb);
13613
13808
  if (!data) return;
13614
13809
  const {
@@ -13628,79 +13823,60 @@ let DefaultCanvasTextRender = class extends BaseRender {
13628
13823
  const matrix = matrixAllocate.allocate(1, 0, 0, 1, 0, 0);
13629
13824
  matrix.rotateByCenter(Math.PI / 2, _x, _y), context.transformFromMatrix(matrix, !0), matrixAllocate.free(matrix);
13630
13825
  }
13631
- doStroke && (strokeCb ? strokeCb(context, text.attribute, textAttribute) : sVisible && (context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute), context.strokeText(t, _x, _y, z))), doFill && (fillCb ? fillCb(context, text.attribute, textAttribute) : fVisible && (context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute), context.fillText(t, _x, _y, z), this.drawUnderLine(underline, lineThrough, text, _x, _y, z, textAttribute, context))), direction && (context.highPerformanceRestore(), context.setTransformForCurrent());
13826
+ doStroke && (strokeCb ? strokeCb(context, text.attribute, textAttribute) : sVisible && (context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute), context.strokeText(t, _x, _y, z))), doFill && (fillCb ? fillCb(context, text.attribute, textAttribute) : fVisible && (context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute), context.fillText(t, _x, _y, z))), direction && (context.highPerformanceRestore(), context.setTransformForCurrent());
13632
13827
  };
13633
- if (text.isMultiLine) {
13634
- if (context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z), "horizontal" === direction) {
13635
- const {
13636
- multilineLayout: multilineLayout
13637
- } = text;
13638
- if (!multilineLayout) return void context.highPerformanceRestore();
13639
- const {
13640
- xOffset: xOffset,
13641
- yOffset: yOffset
13642
- } = multilineLayout.bbox;
13643
- doStroke && (strokeCb ? strokeCb(context, text.attribute, textAttribute) : sVisible && (context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute), multilineLayout.lines.forEach(line => {
13644
- context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
13645
- }))), doFill && (fillCb ? fillCb(context, text.attribute, textAttribute) : fVisible && (context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute), multilineLayout.lines.forEach(line => {
13646
- context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z), this.drawUnderLine(underline, lineThrough, text, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y - textDrawOffsetY("bottom", fontSize) - .05 * fontSize, z, textAttribute, context, {
13647
- width: line.width
13648
- });
13649
- })));
13650
- } else {
13651
- text.tryUpdateAABBBounds();
13652
- const cache = text.cache,
13653
- {
13654
- verticalList: verticalList
13655
- } = cache;
13656
- context.textAlign = "left", context.textBaseline = "top";
13657
- const totalHeight = lineHeight * verticalList.length;
13658
- let totalW = 0;
13659
- verticalList.forEach(verticalData => {
13660
- const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
13661
- totalW = max(_w, totalW);
13662
- });
13663
- let offsetY = 0,
13664
- offsetX = 0;
13665
- "bottom" === textBaseline ? offsetX = -totalHeight : "middle" === textBaseline && (offsetX = -totalHeight / 2), "center" === textAlign ? offsetY -= totalW / 2 : "right" === textAlign && (offsetY -= totalW), verticalList.forEach((verticalData, i) => {
13666
- const currentW = verticalData.reduce((a, b) => a + (b.width || 0), 0),
13667
- dw = totalW - currentW;
13668
- let currentOffsetY = offsetY;
13669
- "center" === textAlign ? currentOffsetY += dw / 2 : "right" === textAlign && (currentOffsetY += dw), verticalData.forEach(item => {
13670
- const {
13671
- text: text,
13672
- width: width,
13673
- direction: direction
13674
- } = item;
13675
- drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction), currentOffsetY += width;
13676
- });
13828
+ if (context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z), "horizontal" === direction) {
13829
+ const {
13830
+ multilineLayout: multilineLayout
13831
+ } = text;
13832
+ if (!multilineLayout) return void context.highPerformanceRestore();
13833
+ const {
13834
+ xOffset: xOffset,
13835
+ yOffset: yOffset
13836
+ } = multilineLayout.bbox;
13837
+ doStroke && (strokeCb ? strokeCb(context, text.attribute, textAttribute) : sVisible && (context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute), multilineLayout.lines.forEach(line => {
13838
+ context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
13839
+ }))), doFill && (fillCb ? fillCb(context, text.attribute, textAttribute) : fVisible && (context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute), multilineLayout.lines.forEach(line => {
13840
+ context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z), this.drawUnderLine(underline, lineThrough, text, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, line.descent, (line.descent - line.ascent) / 2, z, textAttribute, context, {
13841
+ width: line.width
13677
13842
  });
13678
- }
13679
- } else if ("horizontal" === direction) {
13680
- context.setTextStyle(text.attribute, textAttribute, z);
13681
- const t = text.clipedText;
13682
- let dy = 0;
13683
- lineHeight !== fontSize && ("top" === textBaseline ? dy = (lineHeight - fontSize) / 2 : "middle" === textBaseline || "bottom" === textBaseline && (dy = -(lineHeight - fontSize) / 2)), drawText(t, 0, dy, 0);
13843
+ })));
13684
13844
  } else {
13845
+ let {
13846
+ textAlign = textAttribute.textAlign,
13847
+ textBaseline = textAttribute.textBaseline
13848
+ } = text.attribute;
13849
+ if (!verticalMode) {
13850
+ const t = textAlign;
13851
+ textAlign = null !== (_b = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = text.getAlignMapBaseline()[t]) && void 0 !== _c ? _c : "top";
13852
+ }
13685
13853
  text.tryUpdateAABBBounds();
13686
- const cache = text.cache;
13687
- if (cache) {
13688
- context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
13689
- const {
13854
+ const cache = text.cache,
13855
+ {
13690
13856
  verticalList: verticalList
13691
13857
  } = cache;
13692
- let offsetY = 0;
13693
- const totalW = verticalList[0].reduce((a, b) => a + (b.width || 0), 0);
13694
- let offsetX = 0;
13695
- "bottom" === textBaseline ? offsetX = -lineHeight : "middle" === textBaseline && (offsetX = -lineHeight / 2), "center" === textAlign ? offsetY -= totalW / 2 : "right" === textAlign && (offsetY -= totalW), context.textAlign = "left", context.textBaseline = "top", verticalList[0].forEach(item => {
13858
+ context.textAlign = "left", context.textBaseline = "top";
13859
+ const totalHeight = lineHeight * verticalList.length;
13860
+ let totalW = 0;
13861
+ verticalList.forEach(verticalData => {
13862
+ const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
13863
+ totalW = max(_w, totalW);
13864
+ });
13865
+ let offsetY = 0,
13866
+ offsetX = 0;
13867
+ "bottom" === textBaseline ? offsetX = -totalHeight : "middle" === textBaseline && (offsetX = -totalHeight / 2), "center" === textAlign ? offsetY -= totalW / 2 : "right" === textAlign && (offsetY -= totalW), verticalList.forEach((verticalData, i) => {
13868
+ const currentW = verticalData.reduce((a, b) => a + (b.width || 0), 0),
13869
+ dw = totalW - currentW;
13870
+ let currentOffsetY = offsetY;
13871
+ "center" === textAlign ? currentOffsetY += dw / 2 : "right" === textAlign && (currentOffsetY += dw), verticalData.forEach(item => {
13696
13872
  const {
13697
13873
  text: text,
13698
13874
  width: width,
13699
13875
  direction: direction
13700
13876
  } = item;
13701
- drawText(text, offsetX, offsetY, direction), offsetY += width;
13877
+ drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction), currentOffsetY += width;
13702
13878
  });
13703
- }
13879
+ });
13704
13880
  }
13705
13881
  transform3dMatrixToContextMatrix && this.restoreTransformUseContext2d(text, textAttribute, z, context), this.afterRenderStep(text, context, x, y, doFill, doStroke, fVisible, sVisible, textAttribute, drawContext, fillCb, strokeCb);
13706
13882
  }
@@ -13712,12 +13888,10 @@ let DefaultCanvasTextRender = class extends BaseRender {
13712
13888
  computed3dMatrix = !keepDirIn3d;
13713
13889
  this._draw(text, textAttribute, computed3dMatrix, drawContext, params);
13714
13890
  }
13715
- drawUnderLine(underline, lineThrough, text, x, y, z, textAttribute, context, multiOption) {
13891
+ drawUnderLine(underline, lineThrough, text, anchorX, anchorY, offsetUnderLineY, offsetThroughLineY, z, textAttribute, context, multiOption) {
13716
13892
  if (lineThrough + underline <= 0) return;
13717
13893
  const {
13718
13894
  textAlign = textAttribute.textAlign,
13719
- textBaseline = textAttribute.textBaseline,
13720
- fontSize = textAttribute.fontSize,
13721
13895
  fill = textAttribute.fill,
13722
13896
  opacity = textAttribute.opacity,
13723
13897
  underlineOffset = textAttribute.underlineOffset,
@@ -13727,23 +13901,21 @@ let DefaultCanvasTextRender = class extends BaseRender {
13727
13901
  isMulti = !isNil$1(multiOption),
13728
13902
  w = isMulti ? multiOption.width : text.clipedWidth,
13729
13903
  offsetX = isMulti ? 0 : textDrawOffsetX(textAlign, w),
13730
- offsetY = textLayoutOffsetY(isMulti ? "alphabetic" : textBaseline, fontSize, fontSize),
13731
13904
  attribute = {
13732
13905
  lineWidth: 0,
13733
13906
  stroke: fill,
13734
13907
  opacity: opacity,
13735
13908
  strokeOpacity: fillOpacity
13736
13909
  };
13737
- let deltaY = isMulti ? -3 : 0;
13738
13910
  if (underline) {
13739
- attribute.lineWidth = underline, context.setStrokeStyle(text, attribute, x, y, textAttribute), underlineDash && context.setLineDash(underlineDash), context.beginPath();
13740
- const dy = y + offsetY + fontSize + underlineOffset + deltaY;
13741
- context.moveTo(x + offsetX, dy, z), context.lineTo(x + offsetX + w, dy, z), context.stroke();
13911
+ attribute.lineWidth = underline, context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute), underlineDash && context.setLineDash(underlineDash), context.beginPath();
13912
+ const dy = anchorY + offsetUnderLineY + underlineOffset;
13913
+ context.moveTo(anchorX + offsetX, dy, z), context.lineTo(anchorX + offsetX + w, dy, z), context.stroke();
13742
13914
  }
13743
- if (isMulti && (deltaY = -1), lineThrough) {
13744
- attribute.lineWidth = lineThrough, context.setStrokeStyle(text, attribute, x, y, textAttribute), context.beginPath();
13745
- const dy = y + offsetY + fontSize / 2 + deltaY;
13746
- context.moveTo(x + offsetX, dy, z), context.lineTo(x + offsetX + w, dy, z), context.stroke();
13915
+ if (lineThrough) {
13916
+ attribute.lineWidth = lineThrough, context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute), context.beginPath();
13917
+ const dy = anchorY + offsetThroughLineY;
13918
+ context.moveTo(anchorX + offsetX, dy, z), context.lineTo(anchorX + offsetX + w, dy, z), context.stroke();
13747
13919
  }
13748
13920
  }
13749
13921
  };
@@ -13839,7 +14011,8 @@ let DefaultCanvasPolygonRender = class extends BaseRender {
13839
14011
  cornerRadius = polygonAttribute.cornerRadius,
13840
14012
  x: originX = polygonAttribute.x,
13841
14013
  y: originY = polygonAttribute.y,
13842
- closePath = polygonAttribute.closePath
14014
+ closePath = polygonAttribute.closePath,
14015
+ fillStrokeOrder = polygonAttribute.fillStrokeOrder
13843
14016
  } = polygon.attribute,
13844
14017
  data = this.valid(polygon, polygonAttribute, fillCb, strokeCb);
13845
14018
  if (!data) return;
@@ -13849,7 +14022,14 @@ let DefaultCanvasPolygonRender = class extends BaseRender {
13849
14022
  doFill: doFill,
13850
14023
  doStroke: doStroke
13851
14024
  } = data;
13852
- context.beginPath(), cornerRadius <= 0 || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb), doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fVisible && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill())), doStroke && (strokeCb ? strokeCb(context, polygon.attribute, polygonAttribute) : sVisible && (context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.stroke())), this.afterRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
14025
+ context.beginPath(), cornerRadius <= 0 || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
14026
+ const _runFill = () => {
14027
+ doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fVisible && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill()));
14028
+ },
14029
+ _runStroke = () => {
14030
+ doStroke && (strokeCb ? strokeCb(context, polygon.attribute, polygonAttribute) : sVisible && (context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.stroke()));
14031
+ };
14032
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
13853
14033
  }
13854
14034
  draw(polygon, renderService, drawContext, params) {
13855
14035
  const polygonAttribute = getTheme(polygon, null == params ? void 0 : params.theme).polygon;
@@ -13892,7 +14072,10 @@ let DefaultCanvasGroupRender = class {
13892
14072
  cornerRadius = groupAttribute.cornerRadius,
13893
14073
  path = groupAttribute.path,
13894
14074
  lineWidth = groupAttribute.lineWidth,
13895
- visible = groupAttribute.visible
14075
+ visible = groupAttribute.visible,
14076
+ fillStrokeOrder = groupAttribute.fillStrokeOrder,
14077
+ x: originX = groupAttribute.x,
14078
+ y: originY = groupAttribute.y
13896
14079
  } = group.attribute,
13897
14080
  fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
13898
14081
  sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
@@ -13918,7 +14101,14 @@ let DefaultCanvasGroupRender = class {
13918
14101
  };
13919
14102
  this._groupRenderContribitions.forEach(c => {
13920
14103
  c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
13921
- }), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute), doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, x, y, groupAttribute), context.fill())), doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, x, y, groupAttribute), context.stroke())), this._groupRenderContribitions.forEach(c => {
14104
+ }), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);
14105
+ const _runFill = () => {
14106
+ doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, originX - x, originY - y, groupAttribute), context.fill()));
14107
+ },
14108
+ _runStroke = () => {
14109
+ doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, originX - x, originY - y, groupAttribute), context.stroke()));
14110
+ };
14111
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this._groupRenderContribitions.forEach(c => {
13922
14112
  c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
13923
14113
  });
13924
14114
  }
@@ -13984,6 +14174,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
13984
14174
  x: originX = imageAttribute.x,
13985
14175
  y: originY = imageAttribute.y,
13986
14176
  cornerRadius = imageAttribute.cornerRadius,
14177
+ fillStrokeOrder = imageAttribute.fillStrokeOrder,
13987
14178
  image: url
13988
14179
  } = image.attribute,
13989
14180
  data = this.valid(image, imageAttribute, fillCb);
@@ -13994,20 +14185,26 @@ let DefaultCanvasImageRender = class extends BaseRender {
13994
14185
  doFill: doFill,
13995
14186
  doStroke: doStroke
13996
14187
  } = data;
13997
- if (context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
13998
- if (!url || !image.resources) return;
13999
- const res = image.resources.get(url);
14000
- if ("success" !== res.state) return;
14001
- let needRestore = !1;
14002
- 0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
14003
- let repeat = 0;
14004
- if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
14005
- const pattern = context.createPattern(res.data, repeatStr[repeat]);
14006
- context.fillStyle = pattern, context.translate(x, y, !0), context.fillRect(0, 0, width, height), context.translate(-x, -y, !0);
14007
- } else context.drawImage(res.data, x, y, width, height);
14008
- needRestore && context.restore();
14009
- }
14010
- doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke())), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
14188
+ context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
14189
+ const _runFill = () => {
14190
+ if (doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
14191
+ if (!url || !image.resources) return;
14192
+ const res = image.resources.get(url);
14193
+ if ("success" !== res.state) return;
14194
+ let needRestore = !1;
14195
+ 0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
14196
+ let repeat = 0;
14197
+ if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
14198
+ const pattern = context.createPattern(res.data, repeatStr[repeat]);
14199
+ context.fillStyle = pattern, context.translate(x, y, !0), context.fillRect(0, 0, width, height), context.translate(-x, -y, !0);
14200
+ } else context.drawImage(res.data, x, y, width, height);
14201
+ needRestore && context.restore();
14202
+ }
14203
+ },
14204
+ _runStroke = () => {
14205
+ doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke()));
14206
+ };
14207
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
14011
14208
  }
14012
14209
  draw(image, renderService, drawContext) {
14013
14210
  const {
@@ -14401,58 +14598,63 @@ class CanvasTextLayout {
14401
14598
  constructor(fontFamily, options, textMeasure) {
14402
14599
  this.fontFamily = fontFamily, this.textOptions = options, this.textMeasure = textMeasure;
14403
14600
  }
14404
- LayoutBBox(bbox, textAlign, textBaseline) {
14601
+ LayoutBBox(bbox, textAlign, textBaseline, linesLayout) {
14405
14602
  if ("left" === textAlign || "start" === textAlign) bbox.xOffset = 0;else if ("center" === textAlign) bbox.xOffset = bbox.width / -2;else {
14406
14603
  if ("right" !== textAlign && "end" !== textAlign) throw new Error("非法的textAlign");
14407
14604
  bbox.xOffset = -bbox.width;
14408
14605
  }
14409
- return bbox.yOffset = "top" === textBaseline ? 0 : "middle" === textBaseline ? bbox.height / -2 : "alphabetic" === textBaseline ? -.79 * bbox.height : -bbox.height, bbox;
14410
- }
14411
- GetLayout(str, width, height, textAlign, textBaseline, lineHeight, suffix, wordBreak, suffixPosition) {
14412
- const linesLayout = [],
14413
- bboxWH = [width, height],
14414
- bboxOffset = [0, 0];
14415
- for (; str.length > 0;) {
14416
- const {
14417
- str: clipText
14418
- } = this.textMeasure.clipTextWithSuffix(str, this.textOptions, width, suffix, wordBreak, suffixPosition);
14419
- linesLayout.push({
14420
- str: clipText,
14421
- width: this.textMeasure.measureTextWidth(clipText, this.textOptions)
14422
- }), str = str.substring(clipText.length);
14423
- }
14424
- "left" === textAlign || "start" === textAlign || ("center" === textAlign ? bboxOffset[0] = bboxWH[0] / -2 : "right" !== textAlign && "end" !== textAlign || (bboxOffset[0] = -bboxWH[0])), "top" === textBaseline || ("middle" === textBaseline ? bboxOffset[1] = bboxWH[1] / -2 : "bottom" === textBaseline && (bboxOffset[1] = -bboxWH[1]));
14425
- const bbox = {
14426
- xOffset: bboxOffset[0],
14427
- yOffset: bboxOffset[1],
14428
- width: bboxWH[0],
14429
- height: bboxWH[1]
14430
- };
14431
- return this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
14606
+ if ("top" === textBaseline) bbox.yOffset = 0;else if ("middle" === textBaseline) bbox.yOffset = bbox.height / -2;else if ("alphabetic" === textBaseline) {
14607
+ let percent = .79;
14608
+ if (1 === linesLayout.length) {
14609
+ const lineInfo = linesLayout[0];
14610
+ percent = lineInfo.ascent / (lineInfo.ascent + lineInfo.descent);
14611
+ }
14612
+ bbox.yOffset = bbox.height * -percent;
14613
+ } else bbox.yOffset = -bbox.height;
14614
+ return bbox;
14432
14615
  }
14433
14616
  GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
14434
14617
  let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
14435
14618
  let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
14436
- let lineWidth = arguments.length > 6 ? arguments[6] : undefined;
14437
- let suffixPosition = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : "end";
14619
+ let params = arguments.length > 6 ? arguments[6] : undefined;
14620
+ const {
14621
+ lineWidth: lineWidth,
14622
+ suffixPosition = "end",
14623
+ measureMode = MeasureModeEnum.actualBounding,
14624
+ keepCenterInLine = !1
14625
+ } = null != params ? params : {};
14438
14626
  lines = lines.map(l => l.toString());
14439
14627
  const linesLayout = [],
14440
14628
  bboxWH = [0, 0];
14441
14629
  if ("number" == typeof lineWidth && lineWidth !== 1 / 0) {
14442
14630
  let width;
14443
- for (let i = 0, len = lines.length; i < len; i++) width = Math.min(this.textMeasure.measureTextWidth(lines[i], this.textOptions), lineWidth), linesLayout.push({
14444
- str: this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
14445
- width: width
14446
- });
14631
+ for (let i = 0, len = lines.length; i < len; i++) {
14632
+ const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
14633
+ width = Math.min(metrics.width, lineWidth), linesLayout.push({
14634
+ str: metrics.width <= lineWidth ? lines[i].toString() : this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
14635
+ width: width,
14636
+ ascent: metrics.ascent,
14637
+ descent: metrics.descent,
14638
+ keepCenterInLine: keepCenterInLine
14639
+ });
14640
+ }
14447
14641
  bboxWH[0] = lineWidth;
14448
14642
  } else {
14449
- let width, text;
14450
- lineWidth = 0;
14451
- for (let i = 0, len = lines.length; i < len; i++) text = lines[i], width = this.textMeasure.measureTextWidth(text, this.textOptions), lineWidth = Math.max(lineWidth, width), linesLayout.push({
14452
- str: text,
14453
- width: width
14454
- });
14455
- bboxWH[0] = lineWidth;
14643
+ let width,
14644
+ text,
14645
+ _lineWidth = 0;
14646
+ for (let i = 0, len = lines.length; i < len; i++) {
14647
+ text = lines[i];
14648
+ const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
14649
+ width = metrics.width, _lineWidth = Math.max(_lineWidth, width), linesLayout.push({
14650
+ str: text,
14651
+ width: width,
14652
+ ascent: metrics.ascent,
14653
+ descent: metrics.descent,
14654
+ keepCenterInLine: keepCenterInLine
14655
+ });
14656
+ }
14657
+ bboxWH[0] = _lineWidth;
14456
14658
  }
14457
14659
  bboxWH[1] = linesLayout.length * lineHeight, bboxWH[0] = linesLayout.reduce((a, b) => Math.max(a, b.width), 0);
14458
14660
  const bbox = {
@@ -14461,7 +14663,7 @@ class CanvasTextLayout {
14461
14663
  width: bboxWH[0],
14462
14664
  height: bboxWH[1]
14463
14665
  };
14464
- return this.LayoutBBox(bbox, textAlign, textBaseline), this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
14666
+ return this.LayoutBBox(bbox, textAlign, textBaseline, linesLayout), this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
14465
14667
  }
14466
14668
  layoutWithBBox(bbox, lines, textAlign, textBaseline, lineHeight) {
14467
14669
  const origin = [0, 0],
@@ -14480,11 +14682,16 @@ class CanvasTextLayout {
14480
14682
  };
14481
14683
  }
14482
14684
  lineOffset(bbox, line, textAlign, textBaseline, lineHeight, origin) {
14483
- return "left" === textAlign || "start" === textAlign ? line.leftOffset = 0 : "center" === textAlign ? line.leftOffset = (bbox.width - line.width) / 2 : "right" !== textAlign && "end" !== textAlign || (line.leftOffset = bbox.width - line.width), line.topOffset = (lineHeight - this.textOptions.fontSize) / 2 + .79 * this.textOptions.fontSize + origin[1], origin[1] += lineHeight, line;
14685
+ if ("left" === textAlign || "start" === textAlign ? line.leftOffset = 0 : "center" === textAlign ? line.leftOffset = (bbox.width - line.width) / 2 : "right" !== textAlign && "end" !== textAlign || (line.leftOffset = bbox.width - line.width), line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1], !line.keepCenterInLine) {
14686
+ const buf = 0,
14687
+ actualHeightWithBuf = line.ascent + line.descent + buf;
14688
+ actualHeightWithBuf < lineHeight - buf && ("bottom" === textBaseline ? line.topOffset += (lineHeight - actualHeightWithBuf) / 2 : "top" === textBaseline && (line.topOffset -= (lineHeight - actualHeightWithBuf) / 2));
14689
+ }
14690
+ return origin[1] += lineHeight, line;
14484
14691
  }
14485
14692
  }
14486
14693
 
14487
- const TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...GRAPHIC_UPDATE_TAG_KEY];
14694
+ const TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "maxWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...GRAPHIC_UPDATE_TAG_KEY];
14488
14695
  class Text extends Graphic {
14489
14696
  get font() {
14490
14697
  const textTheme = this.getGraphicTheme();
@@ -14493,26 +14700,22 @@ class Text extends Graphic {
14493
14700
  get clipedText() {
14494
14701
  var _a;
14495
14702
  const attribute = this.attribute,
14496
- textTheme = this.getGraphicTheme();
14497
- if (!this.isSimplify()) return;
14498
- const {
14499
- maxLineWidth = textTheme.maxLineWidth
14500
- } = attribute;
14501
- return Number.isFinite(maxLineWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
14703
+ textTheme = this.getGraphicTheme(),
14704
+ maxWidth = this.getMaxWidth(textTheme);
14705
+ return Number.isFinite(maxWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
14502
14706
  }
14503
14707
  get clipedWidth() {
14504
- if (this.isSimplify()) return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
14708
+ return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
14505
14709
  }
14506
14710
  get cliped() {
14507
14711
  var _a, _b;
14508
14712
  const textTheme = this.getGraphicTheme(),
14509
14713
  attribute = this.attribute,
14510
- {
14511
- maxLineWidth = textTheme.maxLineWidth,
14512
- text: text,
14513
- whiteSpace = textTheme.whiteSpace
14514
- } = attribute;
14515
- if (!Number.isFinite(maxLineWidth)) return !1;
14714
+ maxWidth = this.getMaxWidth(textTheme);
14715
+ if (!Number.isFinite(maxWidth)) return !1;
14716
+ const {
14717
+ text: text
14718
+ } = this.attribute;
14516
14719
  if (this.tryUpdateAABBBounds(), null === (_b = null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData) || void 0 === _b ? void 0 : _b.lines) {
14517
14720
  let mergedText = "";
14518
14721
  this.cache.layoutData.lines.forEach(item => {
@@ -14523,10 +14726,7 @@ class Text extends Graphic {
14523
14726
  return "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map(item => item.text).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
14524
14727
  }
14525
14728
  get multilineLayout() {
14526
- if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
14527
- }
14528
- isSimplify() {
14529
- return !this.isMultiLine && "vertical" !== this.attribute.direction;
14729
+ return this.tryUpdateAABBBounds(), this.cache.layoutData;
14530
14730
  }
14531
14731
  get isMultiLine() {
14532
14732
  return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
@@ -14599,8 +14799,74 @@ class Text extends Graphic {
14599
14799
  }
14600
14800
  return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
14601
14801
  }
14802
+ updateSingallineAABBBounds(text) {
14803
+ this.updateMultilineAABBBounds([text]);
14804
+ const layoutData = this.cache.layoutData;
14805
+ if (layoutData) {
14806
+ const line = layoutData.lines[0];
14807
+ this.cache.clipedText = line.str, this.cache.clipedWidth = line.width;
14808
+ }
14809
+ return this._AABBBounds;
14810
+ }
14811
+ updateMultilineAABBBounds(text) {
14812
+ const textTheme = this.getGraphicTheme(),
14813
+ {
14814
+ direction = textTheme.direction,
14815
+ underlineOffset = textTheme.underlineOffset
14816
+ } = this.attribute,
14817
+ b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
14818
+ return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset), b;
14819
+ }
14820
+ guessLineHeightBuf(fontSize) {
14821
+ return fontSize ? .1 * fontSize : 0;
14822
+ }
14823
+ updateHorizontalMultilineAABBBounds(text) {
14824
+ var _a;
14825
+ const textTheme = this.getGraphicTheme(),
14826
+ attribute = this.attribute,
14827
+ {
14828
+ fontFamily = textTheme.fontFamily,
14829
+ textAlign = textTheme.textAlign,
14830
+ textBaseline = textTheme.textBaseline,
14831
+ fontSize = textTheme.fontSize,
14832
+ fontWeight = textTheme.fontWeight,
14833
+ ellipsis = textTheme.ellipsis,
14834
+ maxLineWidth: maxLineWidth,
14835
+ stroke = textTheme.stroke,
14836
+ wrap = textTheme.wrap,
14837
+ measureMode = textTheme.measureMode,
14838
+ lineWidth = textTheme.lineWidth,
14839
+ whiteSpace = textTheme.whiteSpace,
14840
+ suffixPosition = textTheme.suffixPosition,
14841
+ ignoreBuf = textTheme.ignoreBuf,
14842
+ keepCenterInLine = textTheme.keepCenterInLine
14843
+ } = attribute,
14844
+ buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize),
14845
+ lineHeight = this.getLineHeight(attribute, textTheme) + buf;
14846
+ if ("normal" === whiteSpace || wrap) return this.updateWrapAABBBounds(text);
14847
+ if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
14848
+ const bbox = this.cache.layoutData.bbox;
14849
+ return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14850
+ }
14851
+ const textMeasure = application.graphicUtil.textMeasure,
14852
+ layoutData = new CanvasTextLayout(fontFamily, {
14853
+ fontSize: fontSize,
14854
+ fontWeight: fontWeight,
14855
+ fontFamily: fontFamily,
14856
+ lineHeight: lineHeight
14857
+ }, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, {
14858
+ lineWidth: maxLineWidth,
14859
+ suffixPosition: suffixPosition,
14860
+ measureMode: measureMode,
14861
+ keepCenterInLine: keepCenterInLine
14862
+ }),
14863
+ {
14864
+ bbox: bbox
14865
+ } = layoutData;
14866
+ return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14867
+ }
14602
14868
  updateWrapAABBBounds(text) {
14603
- var _a, _b, _c, _d;
14869
+ var _a, _b, _c;
14604
14870
  const textTheme = this.getGraphicTheme(),
14605
14871
  {
14606
14872
  fontFamily = textTheme.fontFamily,
@@ -14614,22 +14880,26 @@ class Text extends Graphic {
14614
14880
  wordBreak = textTheme.wordBreak,
14615
14881
  fontWeight = textTheme.fontWeight,
14616
14882
  ignoreBuf = textTheme.ignoreBuf,
14883
+ measureMode = textTheme.measureMode,
14617
14884
  suffixPosition = textTheme.suffixPosition,
14618
14885
  heightLimit = 0,
14619
- lineClamp: lineClamp
14886
+ lineClamp: lineClamp,
14887
+ keepCenterInLine = textTheme.keepCenterInLine
14620
14888
  } = this.attribute,
14621
- lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
14622
- buf = ignoreBuf ? 0 : 2;
14623
- if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
14889
+ buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize),
14890
+ lineHeight = this.getLineHeight(this.attribute, textTheme) + buf;
14891
+ if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
14624
14892
  const bbox = this.cache.layoutData.bbox;
14625
14893
  return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14626
14894
  }
14627
14895
  const textMeasure = application.graphicUtil.textMeasure,
14628
- layoutObj = new CanvasTextLayout(fontFamily, {
14896
+ textOptions = {
14629
14897
  fontSize: fontSize,
14630
14898
  fontWeight: fontWeight,
14631
- fontFamily: fontFamily
14632
- }, textMeasure),
14899
+ fontFamily: fontFamily,
14900
+ lineHeight: lineHeight
14901
+ },
14902
+ layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure),
14633
14903
  lines = isArray$1(text) ? text.map(l => l.toString()) : [text.toString()],
14634
14904
  linesLayout = [],
14635
14905
  bboxWH = [0, 0];
@@ -14639,29 +14909,37 @@ class Text extends Graphic {
14639
14909
  const str = lines[i];
14640
14910
  let needCut = !0;
14641
14911
  if (i === lineCountLimit - 1) {
14642
- const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition, i !== lines.length - 1);
14912
+ const clip = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition, i !== lines.length - 1),
14913
+ matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
14643
14914
  linesLayout.push({
14644
14915
  str: clip.str,
14645
- width: clip.width
14916
+ width: clip.width,
14917
+ ascent: matrics.ascent,
14918
+ descent: matrics.descent,
14919
+ keepCenterInLine: keepCenterInLine
14646
14920
  });
14647
14921
  break;
14648
14922
  }
14649
- const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
14923
+ const clip = textMeasure.clipText(str, textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
14650
14924
  if ("" !== str && "" === clip.str || clip.wordBreaked) {
14651
14925
  if (ellipsis) {
14652
- const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
14653
- clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
14926
+ const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
14927
+ clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
14654
14928
  } else clip.str = "", clip.width = 0;
14655
14929
  needCut = !1;
14656
14930
  }
14931
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
14657
14932
  linesLayout.push({
14658
14933
  str: clip.str,
14659
- width: clip.width
14934
+ width: clip.width,
14935
+ ascent: matrics.ascent,
14936
+ descent: matrics.descent,
14937
+ keepCenterInLine: keepCenterInLine
14660
14938
  });
14661
14939
  let cutLength = clip.str.length;
14662
14940
  if (!clip.wordBreaked || "" !== str && "" === clip.str || (needCut = !0, cutLength = clip.wordBreaked), clip.str.length === str.length) ;else if (needCut) {
14663
- let newStr = str.substring(cutLength);
14664
- "keep-all" === wordBreak && (newStr = newStr.replace(/^\s+/g, "")), lines.splice(i + 1, 0, newStr);
14941
+ const newStr = str.substring(cutLength);
14942
+ lines.splice(i + 1, 0, newStr);
14665
14943
  }
14666
14944
  }
14667
14945
  let maxWidth = 0;
@@ -14674,235 +14952,46 @@ class Text extends Graphic {
14674
14952
  lineWidth = 0;
14675
14953
  for (let i = 0, len = lines.length; i < len; i++) {
14676
14954
  if (i === lineCountLimit - 1) {
14677
- const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
14955
+ const clip = textMeasure.clipTextWithSuffix(lines[i], textOptions, maxLineWidth, ellipsis, !1, suffixPosition),
14956
+ matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
14678
14957
  linesLayout.push({
14679
14958
  str: clip.str,
14680
- width: clip.width
14959
+ width: clip.width,
14960
+ ascent: matrics.ascent,
14961
+ descent: matrics.descent,
14962
+ keepCenterInLine: keepCenterInLine
14681
14963
  }), lineWidth = Math.max(lineWidth, clip.width);
14682
14964
  break;
14683
14965
  }
14684
- text = lines[i], width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, "break-word" === wordBreak), lineWidth = Math.max(lineWidth, width), linesLayout.push({
14966
+ text = lines[i], width = textMeasure.measureTextWidth(text, textOptions), lineWidth = Math.max(lineWidth, width);
14967
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);
14968
+ linesLayout.push({
14685
14969
  str: text,
14686
- width: width
14970
+ width: width,
14971
+ ascent: matrics.ascent,
14972
+ descent: matrics.descent,
14973
+ keepCenterInLine: keepCenterInLine
14687
14974
  });
14688
14975
  }
14689
14976
  bboxWH[0] = lineWidth;
14690
14977
  }
14691
- bboxWH[1] = linesLayout.length * (lineHeight + buf);
14978
+ bboxWH[1] = linesLayout.length * lineHeight;
14692
14979
  const bbox = {
14693
14980
  xOffset: 0,
14694
14981
  yOffset: 0,
14695
14982
  width: bboxWH[0],
14696
14983
  height: bboxWH[1]
14697
14984
  };
14698
- layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
14985
+ layoutObj.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
14699
14986
  const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
14700
14987
  return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14701
14988
  }
14702
- updateSingallineAABBBounds(text) {
14703
- const textTheme = this.getGraphicTheme(),
14704
- {
14705
- direction = textTheme.direction,
14706
- underlineOffset = textTheme.underlineOffset
14707
- } = this.attribute,
14708
- b = "horizontal" === direction ? this.updateHorizontalSinglelineAABBBounds(text) : this.updateVerticalSinglelineAABBBounds(text);
14709
- return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset), b;
14710
- }
14711
- updateMultilineAABBBounds(text) {
14712
- const textTheme = this.getGraphicTheme(),
14713
- {
14714
- direction = textTheme.direction,
14715
- underlineOffset = textTheme.underlineOffset
14716
- } = this.attribute,
14717
- b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
14718
- return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset), b;
14719
- }
14720
- updateHorizontalSinglelineAABBBounds(text) {
14721
- var _a, _b;
14722
- const textTheme = this.getGraphicTheme(),
14723
- {
14724
- wrap = textTheme.wrap
14725
- } = this.attribute;
14726
- if (wrap) return this.updateWrapAABBBounds([text]);
14727
- const textMeasure = application.graphicUtil.textMeasure;
14728
- let width, str;
14729
- const attribute = this.attribute,
14730
- {
14731
- maxLineWidth = textTheme.maxLineWidth,
14732
- ellipsis = textTheme.ellipsis,
14733
- textAlign = textTheme.textAlign,
14734
- textBaseline = textTheme.textBaseline,
14735
- fontFamily = textTheme.fontFamily,
14736
- fontSize = textTheme.fontSize,
14737
- fontWeight = textTheme.fontWeight,
14738
- stroke = textTheme.stroke,
14739
- lineWidth = textTheme.lineWidth,
14740
- ignoreBuf = textTheme.ignoreBuf,
14741
- whiteSpace = textTheme.whiteSpace,
14742
- suffixPosition = textTheme.suffixPosition
14743
- } = attribute;
14744
- if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
14745
- const buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
14746
- textFontSize = attribute.fontSize || textTheme.fontSize,
14747
- lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
14748
- if (!this.shouldUpdateShape() && this.cache) {
14749
- width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
14750
- const dx = textDrawOffsetX(textAlign, width),
14751
- dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
14752
- return this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14753
- }
14754
- if (Number.isFinite(maxLineWidth)) {
14755
- if (ellipsis) {
14756
- const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis,
14757
- data = textMeasure.clipTextWithSuffix(text.toString(), {
14758
- fontSize: fontSize,
14759
- fontWeight: fontWeight,
14760
- fontFamily: fontFamily
14761
- }, maxLineWidth, strEllipsis, !1, suffixPosition);
14762
- str = data.str, width = data.width;
14763
- } else {
14764
- const data = textMeasure.clipText(text.toString(), {
14765
- fontSize: fontSize,
14766
- fontWeight: fontWeight,
14767
- fontFamily: fontFamily
14768
- }, maxLineWidth, !1);
14769
- str = data.str, width = data.width;
14770
- }
14771
- this.cache.clipedText = str, this.cache.clipedWidth = width;
14772
- } else width = textMeasure.measureTextWidth(text.toString(), {
14773
- fontSize: fontSize,
14774
- fontWeight: fontWeight,
14775
- fontFamily: fontFamily
14776
- }), this.cache.clipedText = text.toString(), this.cache.clipedWidth = width;
14777
- this.clearUpdateShapeTag();
14778
- const dx = textDrawOffsetX(textAlign, width);
14779
- let lh = lineHeight;
14780
- application.global && application.global.isSafari() && (lh += .2 * fontSize);
14781
- const dy = textLayoutOffsetY(textBaseline, lh, fontSize, buf);
14782
- return this._AABBBounds.set(dx, dy, dx + width, dy + lh), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14783
- }
14784
- getBaselineMapAlign() {
14785
- return Text.baselineMapAlign;
14786
- }
14787
- getAlignMapBaseline() {
14788
- return Text.alignMapBaseline;
14789
- }
14790
- updateVerticalSinglelineAABBBounds(text) {
14791
- var _a, _b, _c;
14792
- const textTheme = this.getGraphicTheme(),
14793
- textMeasure = application.graphicUtil.textMeasure;
14794
- let width;
14795
- const attribute = this.attribute,
14796
- {
14797
- ignoreBuf = textTheme.ignoreBuf
14798
- } = attribute,
14799
- buf = ignoreBuf ? 0 : 2,
14800
- {
14801
- maxLineWidth = textTheme.maxLineWidth,
14802
- ellipsis = textTheme.ellipsis,
14803
- fontSize = textTheme.fontSize,
14804
- fontWeight = textTheme.fontWeight,
14805
- fontFamily = textTheme.fontFamily,
14806
- stroke = textTheme.stroke,
14807
- lineWidth = textTheme.lineWidth,
14808
- verticalMode = textTheme.verticalMode,
14809
- suffixPosition = textTheme.suffixPosition
14810
- } = attribute,
14811
- lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
14812
- let {
14813
- textAlign = textTheme.textAlign,
14814
- textBaseline = textTheme.textBaseline
14815
- } = attribute;
14816
- if (!verticalMode) {
14817
- const t = textAlign;
14818
- textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
14819
- }
14820
- if (!this.shouldUpdateShape() && this.cache) {
14821
- width = this.cache.clipedWidth;
14822
- const dx = textDrawOffsetX(textAlign, width),
14823
- dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
14824
- return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14825
- }
14826
- let verticalList = [verticalLayout(text.toString())];
14827
- if (Number.isFinite(maxLineWidth)) {
14828
- if (ellipsis) {
14829
- const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis,
14830
- data = textMeasure.clipTextWithSuffixVertical(verticalList[0], {
14831
- fontSize: fontSize,
14832
- fontWeight: fontWeight,
14833
- fontFamily: fontFamily
14834
- }, maxLineWidth, strEllipsis, !1, suffixPosition);
14835
- verticalList = [data.verticalList], width = data.width;
14836
- } else {
14837
- const data = textMeasure.clipTextVertical(verticalList[0], {
14838
- fontSize: fontSize,
14839
- fontWeight: fontWeight,
14840
- fontFamily: fontFamily
14841
- }, maxLineWidth, !1);
14842
- verticalList = [data.verticalList], width = data.width;
14843
- }
14844
- this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
14845
- } else width = 0, verticalList[0].forEach(t => {
14846
- const w = t.direction === TextDirection.HORIZONTAL ? fontSize : textMeasure.measureTextWidth(t.text, {
14847
- fontSize: fontSize,
14848
- fontWeight: fontWeight,
14849
- fontFamily: fontFamily
14850
- });
14851
- width += w, t.width = w;
14852
- }), this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
14853
- this.clearUpdateShapeTag();
14854
- const dx = textDrawOffsetX(textAlign, width),
14855
- dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
14856
- return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14857
- }
14858
- updateHorizontalMultilineAABBBounds(text) {
14859
- var _a, _b;
14860
- const textTheme = this.getGraphicTheme(),
14861
- {
14862
- wrap = textTheme.wrap
14863
- } = this.attribute;
14864
- if (wrap) return this.updateWrapAABBBounds(text);
14865
- const attribute = this.attribute,
14866
- {
14867
- fontFamily = textTheme.fontFamily,
14868
- textAlign = textTheme.textAlign,
14869
- textBaseline = textTheme.textBaseline,
14870
- fontSize = textTheme.fontSize,
14871
- fontWeight = textTheme.fontWeight,
14872
- ellipsis = textTheme.ellipsis,
14873
- maxLineWidth: maxLineWidth,
14874
- stroke = textTheme.stroke,
14875
- lineWidth = textTheme.lineWidth,
14876
- whiteSpace = textTheme.whiteSpace,
14877
- suffixPosition = textTheme.suffixPosition
14878
- } = attribute,
14879
- lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
14880
- if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
14881
- if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
14882
- const bbox = this.cache.layoutData.bbox;
14883
- return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14884
- }
14885
- const textMeasure = application.graphicUtil.textMeasure,
14886
- layoutData = new CanvasTextLayout(fontFamily, {
14887
- fontSize: fontSize,
14888
- fontWeight: fontWeight,
14889
- fontFamily: fontFamily
14890
- }, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, maxLineWidth, suffixPosition),
14891
- {
14892
- bbox: bbox
14893
- } = layoutData;
14894
- return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14895
- }
14896
14989
  updateVerticalMultilineAABBBounds(text) {
14897
- var _a, _b, _c;
14990
+ var _a, _b;
14898
14991
  const textTheme = this.getGraphicTheme(),
14899
14992
  textMeasure = application.graphicUtil.textMeasure;
14900
14993
  let width;
14901
14994
  const attribute = this.attribute,
14902
- {
14903
- ignoreBuf = textTheme.ignoreBuf
14904
- } = attribute,
14905
- buf = ignoreBuf ? 0 : 2,
14906
14995
  {
14907
14996
  maxLineWidth = textTheme.maxLineWidth,
14908
14997
  ellipsis = textTheme.ellipsis,
@@ -14914,14 +15003,14 @@ class Text extends Graphic {
14914
15003
  verticalMode = textTheme.verticalMode,
14915
15004
  suffixPosition = textTheme.suffixPosition
14916
15005
  } = attribute,
14917
- lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
15006
+ lineHeight = this.getLineHeight(attribute, textTheme);
14918
15007
  let {
14919
15008
  textAlign = textTheme.textAlign,
14920
15009
  textBaseline = textTheme.textBaseline
14921
15010
  } = attribute;
14922
15011
  if (!verticalMode) {
14923
15012
  const t = textAlign;
14924
- textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
15013
+ textAlign = null !== (_a = Text.baselineMapAlign[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = Text.alignMapBaseline[t]) && void 0 !== _b ? _b : "top";
14925
15014
  }
14926
15015
  if (width = 0, !this.shouldUpdateShape() && this.cache) {
14927
15016
  this.cache.verticalList.forEach(item => {
@@ -14969,6 +15058,15 @@ class Text extends Graphic {
14969
15058
  dy = textLayoutOffsetY(textBaseline, height, fontSize);
14970
15059
  return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14971
15060
  }
15061
+ getMaxWidth(theme) {
15062
+ var _a, _b;
15063
+ const attribute = this.attribute;
15064
+ return null !== (_b = null !== (_a = attribute.maxLineWidth) && void 0 !== _a ? _a : attribute.maxWidth) && void 0 !== _b ? _b : theme.maxWidth;
15065
+ }
15066
+ getLineHeight(attribute, textTheme) {
15067
+ var _a;
15068
+ return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
15069
+ }
14972
15070
  needUpdateTags(keys) {
14973
15071
  let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
14974
15072
  return super.needUpdateTags(keys, k);
@@ -14983,6 +15081,12 @@ class Text extends Graphic {
14983
15081
  getNoWorkAnimateAttr() {
14984
15082
  return Text.NOWORK_ANIMATE_ATTR;
14985
15083
  }
15084
+ getBaselineMapAlign() {
15085
+ return Text.baselineMapAlign;
15086
+ }
15087
+ getAlignMapBaseline() {
15088
+ return Text.alignMapBaseline;
15089
+ }
14986
15090
  }
14987
15091
  Text.NOWORK_ANIMATE_ATTR = Object.assign({
14988
15092
  ellipsis: 1,
@@ -15061,7 +15165,10 @@ class WrapText extends Text {
15061
15165
  const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
15062
15166
  linesLayout.push({
15063
15167
  str: clip.str,
15064
- width: clip.width
15168
+ width: clip.width,
15169
+ ascent: 0,
15170
+ descent: 0,
15171
+ keepCenterInLine: !1
15065
15172
  });
15066
15173
  break;
15067
15174
  }
@@ -15075,7 +15182,10 @@ class WrapText extends Text {
15075
15182
  }
15076
15183
  if (linesLayout.push({
15077
15184
  str: clip.str,
15078
- width: clip.width
15185
+ width: clip.width,
15186
+ ascent: 0,
15187
+ descent: 0,
15188
+ keepCenterInLine: !1
15079
15189
  }), clip.str.length === str.length) ;else if (needCut) {
15080
15190
  const newStr = str.substring(clip.str.length);
15081
15191
  lines.splice(i + 1, 0, newStr);
@@ -15094,13 +15204,19 @@ class WrapText extends Text {
15094
15204
  const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
15095
15205
  linesLayout.push({
15096
15206
  str: clip.str,
15097
- width: clip.width
15207
+ width: clip.width,
15208
+ ascent: 0,
15209
+ descent: 0,
15210
+ keepCenterInLine: !1
15098
15211
  }), lineWidth = Math.max(lineWidth, clip.width);
15099
15212
  break;
15100
15213
  }
15101
15214
  text = lines[i], width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, "break-word" === wordBreak), lineWidth = Math.max(lineWidth, width), linesLayout.push({
15102
15215
  str: text,
15103
- width: width
15216
+ width: width,
15217
+ ascent: 0,
15218
+ descent: 0,
15219
+ keepCenterInLine: !1
15104
15220
  });
15105
15221
  }
15106
15222
  bboxWH[0] = lineWidth;
@@ -15144,6 +15260,9 @@ class BaseSymbol {
15144
15260
  bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
15145
15261
  } else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
15146
15262
  }
15263
+ parseSize(size) {
15264
+ return isNumber$1(size) ? size : Math.min(size[0], size[1]);
15265
+ }
15147
15266
  }
15148
15267
 
15149
15268
  function circle(ctx, r, x, y, z) {
@@ -15154,13 +15273,13 @@ class CircleSymbol extends BaseSymbol {
15154
15273
  super(...arguments), this.type = "circle", this.pathStr = "M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0";
15155
15274
  }
15156
15275
  draw(ctx, size, x, y, z) {
15157
- return circle(ctx, size / 2, x, y, z);
15276
+ return circle(ctx, this.parseSize(size) / 2, x, y, z);
15158
15277
  }
15159
15278
  drawOffset(ctx, size, x, y, offset, z) {
15160
- return circle(ctx, size / 2 + offset, x, y, z);
15279
+ return circle(ctx, this.parseSize(size) / 2 + offset, x, y, z);
15161
15280
  }
15162
15281
  drawToSvgPath(size, x, y, z) {
15163
- const r = size / 2;
15282
+ const r = this.parseSize(size) / 2;
15164
15283
  return `M ${x - r}, ${y} a ${r},${r} 0 1,0 ${2 * r},0 a ${r},${r} 0 1,0 -${2 * r},0`;
15165
15284
  }
15166
15285
  }
@@ -15177,10 +15296,10 @@ class CrossSymbol extends BaseSymbol {
15177
15296
  super(...arguments), this.type = "cross", this.pathStr = "M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z";
15178
15297
  }
15179
15298
  draw(ctx, size, x, y, z) {
15180
- return cross(ctx, size / 6, x, y, z);
15299
+ return cross(ctx, this.parseSize(size) / 6, x, y, z);
15181
15300
  }
15182
15301
  drawOffset(ctx, size, x, y, offset, z) {
15183
- return crossOffset(ctx, size / 6, x, y, offset, z);
15302
+ return crossOffset(ctx, this.parseSize(size) / 6, x, y, offset, z);
15184
15303
  }
15185
15304
  }
15186
15305
  var cross$1 = new CrossSymbol();
@@ -15193,13 +15312,13 @@ class DiamondSymbol extends BaseSymbol {
15193
15312
  super(...arguments), this.type = "diamond", this.pathStr = "M-0.5,0L0,-0.5L0.5,0L0,0.5Z";
15194
15313
  }
15195
15314
  draw(ctx, size, x, y, z) {
15196
- return diamond(ctx, size / 2, x, y, z);
15315
+ return diamond(ctx, this.parseSize(size) / 2, x, y, z);
15197
15316
  }
15198
15317
  drawFitDir(ctx, size, x, y, z) {
15199
- return diamond(ctx, size / 2, x, y, z);
15318
+ return diamond(ctx, this.parseSize(size) / 2, x, y, z);
15200
15319
  }
15201
15320
  drawOffset(ctx, size, x, y, offset, z) {
15202
- return diamond(ctx, size / 2 + offset, x, y, z);
15321
+ return diamond(ctx, this.parseSize(size) / 2 + offset, x, y, z);
15203
15322
  }
15204
15323
  }
15205
15324
  var diamond$1 = new DiamondSymbol();
@@ -15213,10 +15332,10 @@ class SquareSymbol extends BaseSymbol {
15213
15332
  super(...arguments), this.type = "square", this.pathStr = "M-0.5,-0.5h1v1h-1Z";
15214
15333
  }
15215
15334
  draw(ctx, size, x, y) {
15216
- return square(ctx, size / 2, x, y);
15335
+ return square(ctx, this.parseSize(size) / 2, x, y);
15217
15336
  }
15218
15337
  drawOffset(ctx, size, x, y, offset) {
15219
- return square(ctx, size / 2 + offset, x, y);
15338
+ return square(ctx, this.parseSize(size) / 2 + offset, x, y);
15220
15339
  }
15221
15340
  }
15222
15341
  var square$1 = new SquareSymbol();
@@ -15230,10 +15349,10 @@ class TriangleUpSymbol extends BaseSymbol {
15230
15349
  super(...arguments), this.type = "triangleUp", this.pathStr = "M0.5,0.5 L-0.5,0.5 L0,-0.5 Z";
15231
15350
  }
15232
15351
  draw(ctx, size, x, y) {
15233
- return trianglUpOffset(ctx, size / 2, x, y);
15352
+ return trianglUpOffset(ctx, this.parseSize(size) / 2, x, y);
15234
15353
  }
15235
15354
  drawOffset(ctx, size, x, y, offset) {
15236
- return trianglUpOffset(ctx, size / 2, x, y, offset);
15355
+ return trianglUpOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15237
15356
  }
15238
15357
  }
15239
15358
  var triangleUp = new TriangleUpSymbol();
@@ -15265,10 +15384,10 @@ class StarSymbol extends BaseSymbol {
15265
15384
  super(...arguments), this.type = "star", this.pathStr = "M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z";
15266
15385
  }
15267
15386
  draw(ctx, size, transX, transY) {
15268
- return star(ctx, size / 2, transX, transY);
15387
+ return star(ctx, this.parseSize(size) / 2, transX, transY);
15269
15388
  }
15270
15389
  drawOffset(ctx, size, transX, transY, offset) {
15271
- return star(ctx, size / 2 + offset, transX, transY);
15390
+ return star(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15272
15391
  }
15273
15392
  }
15274
15393
  var star$1 = new StarSymbol();
@@ -15286,10 +15405,10 @@ class ArrowSymbol extends BaseSymbol {
15286
15405
  super(...arguments), this.type = "arrow", this.pathStr = "M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z";
15287
15406
  }
15288
15407
  draw(ctx, size, transX, transY) {
15289
- return arrow(ctx, size / 2, transX, transY);
15408
+ return arrow(ctx, this.parseSize(size) / 2, transX, transY);
15290
15409
  }
15291
15410
  drawOffset(ctx, size, transX, transY, offset) {
15292
- return arrow(ctx, size / 2 + offset, transX, transY);
15411
+ return arrow(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15293
15412
  }
15294
15413
  }
15295
15414
  var arrow$1 = new ArrowSymbol();
@@ -15303,10 +15422,10 @@ class WedgeSymbol extends BaseSymbol {
15303
15422
  super(...arguments), this.type = "wedge", this.pathStr = "M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z";
15304
15423
  }
15305
15424
  draw(ctx, size, transX, transY) {
15306
- return wedge(ctx, size / 2, transX, transY);
15425
+ return wedge(ctx, this.parseSize(size) / 2, transX, transY);
15307
15426
  }
15308
15427
  drawOffset(ctx, size, transX, transY, offset) {
15309
- return wedge(ctx, size / 2 + offset, transX, transY);
15428
+ return wedge(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15310
15429
  }
15311
15430
  }
15312
15431
  var wedge$1 = new WedgeSymbol();
@@ -15319,10 +15438,10 @@ class StrokeSymbol extends BaseSymbol {
15319
15438
  super(...arguments), this.type = "stroke", this.pathStr = "";
15320
15439
  }
15321
15440
  draw(ctx, size, transX, transY) {
15322
- return stroke(ctx, size / 2, transX, transY);
15441
+ return stroke(ctx, this.parseSize(size) / 2, transX, transY);
15323
15442
  }
15324
15443
  drawOffset(ctx, size, transX, transY, offset) {
15325
- return stroke(ctx, size / 2 + offset, transX, transY);
15444
+ return stroke(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15326
15445
  }
15327
15446
  }
15328
15447
  var stroke$1 = new StrokeSymbol();
@@ -15344,10 +15463,10 @@ class WyeSymbol extends BaseSymbol {
15344
15463
  super(...arguments), this.type = "wye", this.pathStr = "M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z";
15345
15464
  }
15346
15465
  draw(ctx, size, transX, transY) {
15347
- return wye(ctx, size / 2, transX, transY);
15466
+ return wye(ctx, this.parseSize(size) / 2, transX, transY);
15348
15467
  }
15349
15468
  drawOffset(ctx, size, transX, transY, offset) {
15350
- return wye(ctx, size / 2 + offset, transX, transY);
15469
+ return wye(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15351
15470
  }
15352
15471
  }
15353
15472
  var wye$1 = new WyeSymbol();
@@ -15360,10 +15479,10 @@ class TriangleLeftSymbol extends BaseSymbol {
15360
15479
  super(...arguments), this.type = "triangleLeft", this.pathStr = "M-0.5,0 L0.5,0.5 L0.5,-0.5 Z";
15361
15480
  }
15362
15481
  draw(ctx, size, x, y) {
15363
- return trianglLeftOffset(ctx, size / 2, x, y, 0);
15482
+ return trianglLeftOffset(ctx, this.parseSize(size) / 2, x, y, 0);
15364
15483
  }
15365
15484
  drawOffset(ctx, size, x, y, offset) {
15366
- return trianglLeftOffset(ctx, size / 2, x, y, offset);
15485
+ return trianglLeftOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15367
15486
  }
15368
15487
  }
15369
15488
  var triangleLeft = new TriangleLeftSymbol();
@@ -15377,10 +15496,10 @@ class TriangleRightSymbol extends BaseSymbol {
15377
15496
  super(...arguments), this.type = "triangleRight", this.pathStr = "M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z";
15378
15497
  }
15379
15498
  draw(ctx, size, x, y) {
15380
- return trianglRightOffset(ctx, size / 2, x, y);
15499
+ return trianglRightOffset(ctx, this.parseSize(size) / 2, x, y);
15381
15500
  }
15382
15501
  drawOffset(ctx, size, x, y, offset) {
15383
- return trianglRightOffset(ctx, size / 2, x, y, offset);
15502
+ return trianglRightOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15384
15503
  }
15385
15504
  }
15386
15505
  var triangleRight = new TriangleRightSymbol();
@@ -15394,10 +15513,10 @@ class TriangleDownSymbol extends BaseSymbol {
15394
15513
  super(...arguments), this.type = "triangleDown", this.pathStr = "M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z";
15395
15514
  }
15396
15515
  draw(ctx, size, x, y) {
15397
- return trianglDownOffset(ctx, size / 2, x, y);
15516
+ return trianglDownOffset(ctx, this.parseSize(size) / 2, x, y);
15398
15517
  }
15399
15518
  drawOffset(ctx, size, x, y, offset) {
15400
- return trianglDownOffset(ctx, size / 2, x, y, offset);
15519
+ return trianglDownOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15401
15520
  }
15402
15521
  }
15403
15522
  var triangleDown = new TriangleDownSymbol();
@@ -15412,10 +15531,10 @@ class ThinTriangleSymbol extends BaseSymbol {
15412
15531
  super(...arguments), this.type = "thinTriangle", this.pathStr = "M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z";
15413
15532
  }
15414
15533
  draw(ctx, size, x, y) {
15415
- return thinTriangle(ctx, size / 2 / sqrt3, x, y);
15534
+ return thinTriangle(ctx, this.parseSize(size) / 2 / sqrt3, x, y);
15416
15535
  }
15417
15536
  drawOffset(ctx, size, x, y, offset) {
15418
- return thinTriangle(ctx, size / 2 / sqrt3 + offset, x, y);
15537
+ return thinTriangle(ctx, this.parseSize(size) / 2 / sqrt3 + offset, x, y);
15419
15538
  }
15420
15539
  }
15421
15540
  var thinTriangle$1 = new ThinTriangleSymbol();
@@ -15429,10 +15548,10 @@ class Arrow2LeftSymbol extends BaseSymbol {
15429
15548
  super(...arguments), this.type = "arrow2Left", this.pathStr = "M 0.25 -0.5 L -0.25 0 l 0.25 0.5";
15430
15549
  }
15431
15550
  draw(ctx, size, transX, transY) {
15432
- return arrow2Left(ctx, size / 4, transX, transY);
15551
+ return arrow2Left(ctx, this.parseSize(size) / 4, transX, transY);
15433
15552
  }
15434
15553
  drawOffset(ctx, size, transX, transY, offset) {
15435
- return arrow2Left(ctx, size / 4 + offset, transX, transY);
15554
+ return arrow2Left(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15436
15555
  }
15437
15556
  }
15438
15557
  var arrow2Left$1 = new Arrow2LeftSymbol();
@@ -15446,10 +15565,10 @@ class Arrow2RightSymbol extends BaseSymbol {
15446
15565
  super(...arguments), this.type = "arrow2Right", this.pathStr = "M -0.25 -0.5 l 0.25 0 l -0.25 0.5";
15447
15566
  }
15448
15567
  draw(ctx, size, transX, transY) {
15449
- return arrow2Right(ctx, size / 4, transX, transY);
15568
+ return arrow2Right(ctx, this.parseSize(size) / 4, transX, transY);
15450
15569
  }
15451
15570
  drawOffset(ctx, size, transX, transY, offset) {
15452
- return arrow2Right(ctx, size / 4 + offset, transX, transY);
15571
+ return arrow2Right(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15453
15572
  }
15454
15573
  }
15455
15574
  var arrow2Right$1 = new Arrow2RightSymbol();
@@ -15463,10 +15582,10 @@ class Arrow2UpSymbol extends BaseSymbol {
15463
15582
  super(...arguments), this.type = "arrow2Up", this.pathStr = "M -0.5 0.25 L 0 -0.25 l 0.5 0.25";
15464
15583
  }
15465
15584
  draw(ctx, size, transX, transY) {
15466
- return arrow2Up(ctx, size / 4, transX, transY);
15585
+ return arrow2Up(ctx, this.parseSize(size) / 4, transX, transY);
15467
15586
  }
15468
15587
  drawOffset(ctx, size, transX, transY, offset) {
15469
- return arrow2Up(ctx, size / 4 + offset, transX, transY);
15588
+ return arrow2Up(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15470
15589
  }
15471
15590
  }
15472
15591
  var arrow2Up$1 = new Arrow2UpSymbol();
@@ -15480,10 +15599,10 @@ class Arrow2DownSymbol extends BaseSymbol {
15480
15599
  super(...arguments), this.type = "arrow2Down", this.pathStr = "M -0.5 -0.25 L 0 0.25 l 0.5 -0.25";
15481
15600
  }
15482
15601
  draw(ctx, size, transX, transY) {
15483
- return arrow2Down(ctx, size / 4, transX, transY);
15602
+ return arrow2Down(ctx, this.parseSize(size) / 4, transX, transY);
15484
15603
  }
15485
15604
  drawOffset(ctx, size, transX, transY, offset) {
15486
- return arrow2Down(ctx, size / 4 + offset, transX, transY);
15605
+ return arrow2Down(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15487
15606
  }
15488
15607
  }
15489
15608
  var arrow2Down$1 = new Arrow2DownSymbol();
@@ -15496,13 +15615,13 @@ class LineVSymbol extends BaseSymbol {
15496
15615
  super(...arguments), this.type = "lineV", this.pathStr = "M0,-0.5L0,0.5";
15497
15616
  }
15498
15617
  draw(ctx, size, x, y, z) {
15499
- return lineV(ctx, size / 2, x, y);
15618
+ return lineV(ctx, this.parseSize(size) / 2, x, y);
15500
15619
  }
15501
15620
  drawOffset(ctx, size, x, y, offset, z) {
15502
- return lineV(ctx, size / 2 + offset, x, y);
15621
+ return lineV(ctx, this.parseSize(size) / 2 + offset, x, y);
15503
15622
  }
15504
15623
  drawToSvgPath(size, x, y, z) {
15505
- const r = size / 2;
15624
+ const r = this.parseSize(size) / 2;
15506
15625
  return `M ${x}, ${y - r} L ${x},${y + r}`;
15507
15626
  }
15508
15627
  }
@@ -15516,13 +15635,13 @@ class LineHSymbol extends BaseSymbol {
15516
15635
  super(...arguments), this.type = "lineH", this.pathStr = "M-0.5,0L0.5,0";
15517
15636
  }
15518
15637
  draw(ctx, size, x, y, z) {
15519
- return lineH(ctx, size / 2, x, y);
15638
+ return lineH(ctx, this.parseSize(size) / 2, x, y);
15520
15639
  }
15521
15640
  drawOffset(ctx, size, x, y, offset, z) {
15522
- return lineH(ctx, size / 2 + offset, x, y);
15641
+ return lineH(ctx, this.parseSize(size) / 2 + offset, x, y);
15523
15642
  }
15524
15643
  drawToSvgPath(size, x, y, z) {
15525
- const r = size / 2;
15644
+ const r = this.parseSize(size) / 2;
15526
15645
  return `M ${x - r}, ${y} L ${x + r},${y}`;
15527
15646
  }
15528
15647
  }
@@ -15536,13 +15655,13 @@ class CloseSymbol extends BaseSymbol {
15536
15655
  super(...arguments), this.type = "close", this.pathStr = "M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5";
15537
15656
  }
15538
15657
  draw(ctx, size, x, y, z) {
15539
- return close(ctx, size / 2, x, y);
15658
+ return close(ctx, this.parseSize(size) / 2, x, y);
15540
15659
  }
15541
15660
  drawOffset(ctx, size, x, y, offset, z) {
15542
- return close(ctx, size / 2 + offset, x, y);
15661
+ return close(ctx, this.parseSize(size) / 2 + offset, x, y);
15543
15662
  }
15544
15663
  drawToSvgPath(size, x, y, z) {
15545
- const r = size / 2;
15664
+ const r = this.parseSize(size) / 2;
15546
15665
  return `M ${x - r}, ${y - r} L ${x + r},${y + r} M ${x + r}, ${y - r} L ${x - r},${y + r}`;
15547
15666
  }
15548
15667
  }
@@ -15576,15 +15695,18 @@ class CustomSymbolClass {
15576
15695
  this.pathStr = "", this.type = type, isArray$1(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
15577
15696
  }
15578
15697
  drawOffset(ctx, size, x, y, offset, z, cb) {
15579
- return this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
15698
+ return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
15580
15699
  ctx.beginPath(), renderCommandList(item.path.commandList, ctx, x, y, size, size), cb && cb(item.path, item.attribute);
15581
15700
  }), !1) : (renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset), !1);
15582
15701
  }
15583
15702
  draw(ctx, size, x, y, z, cb) {
15584
- return this.drawOffset(ctx, size, x, y, 0, z, cb);
15703
+ return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
15704
+ }
15705
+ parseSize(size) {
15706
+ return isNumber$1(size) ? size : Math.min(size[0], size[1]);
15585
15707
  }
15586
15708
  bounds(size, bounds) {
15587
- if (this.isSvg) {
15709
+ if (size = this.parseSize(size), this.isSvg) {
15588
15710
  if (!this.svgCache) return;
15589
15711
  return bounds.clear(), void this.svgCache.forEach(_ref => {
15590
15712
  let {
@@ -16267,7 +16389,11 @@ class Paragraph {
16267
16389
  case "sub":
16268
16390
  baseline += this.descent / 2;
16269
16391
  }
16270
- "vertical" === direction && (ctx.save(), ctx.rotateAbout(Math.PI / 2, left, baseline), ctx.translate(-this.heightOrigin || -this.lineHeight / 2, -this.descent / 2), ctx.translate(left, baseline), left = 0, baseline = 0), this.character.stroke && (applyStrokeStyle(ctx, this.character), ctx.strokeText(text, left, baseline)), applyFillStyle(ctx, this.character), this.character.fill && ctx.fillText(text, left, baseline), this.character.fill && ("boolean" == typeof this.character.lineThrough || "boolean" == typeof this.character.underline ? (this.character.underline && ctx.fillRect(left, 1 + baseline, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1), this.character.lineThrough && ctx.fillRect(left, 1 + baseline - this.ascent / 2, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1)) : "underline" === this.character.textDecoration ? ctx.fillRect(left, 1 + baseline, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1) : "line-through" === this.character.textDecoration && ctx.fillRect(left, 1 + baseline - this.ascent / 2, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1)), "vertical" === direction && ctx.restore();
16392
+ "vertical" === direction && (ctx.save(), ctx.rotateAbout(Math.PI / 2, left, baseline), ctx.translate(-this.heightOrigin || -this.lineHeight / 2, -this.descent / 2), ctx.translate(left, baseline), left = 0, baseline = 0);
16393
+ const {
16394
+ lineWidth = 1
16395
+ } = this.character;
16396
+ this.character.stroke && lineWidth && (applyStrokeStyle(ctx, this.character), ctx.strokeText(text, left, baseline)), applyFillStyle(ctx, this.character), this.character.fill && ctx.fillText(text, left, baseline), this.character.fill && ("boolean" == typeof this.character.lineThrough || "boolean" == typeof this.character.underline ? (this.character.underline && ctx.fillRect(left, 1 + baseline, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1), this.character.lineThrough && ctx.fillRect(left, 1 + baseline - this.ascent / 2, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1)) : "underline" === this.character.textDecoration ? ctx.fillRect(left, 1 + baseline, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1) : "line-through" === this.character.textDecoration && ctx.fillRect(left, 1 + baseline - this.ascent / 2, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1)), "vertical" === direction && ctx.restore();
16271
16397
  }
16272
16398
  getWidthWithEllips(direction) {
16273
16399
  let text = this.text;
@@ -18272,6 +18398,42 @@ class AutoRenderPlugin {
18272
18398
  }
18273
18399
  }
18274
18400
 
18401
+ class AutoRefreshPlugin {
18402
+ constructor() {
18403
+ this.name = "AutoRefreshPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.handleChange = graphic => {
18404
+ graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage === this.pluginService.stage && null != graphic.stage && graphic.stage.renderNextFrame();
18405
+ };
18406
+ }
18407
+ activate(context) {
18408
+ this.pluginService = context, this.dpr = application.global.devicePixelRatio, this.refresh();
18409
+ }
18410
+ refresh() {
18411
+ this._refreshByMediaQuery() || this._refreshByRaf();
18412
+ }
18413
+ _refreshByRaf() {
18414
+ const raf = application.global.getRequestAnimationFrame();
18415
+ this.rafId = raf(() => {
18416
+ application.global.devicePixelRatio !== this.dpr && (this.dpr = application.global.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0)), this.refresh();
18417
+ });
18418
+ }
18419
+ _refreshByMediaQuery() {
18420
+ try {
18421
+ const mqString = `(resolution: ${window.devicePixelRatio}dppx)`,
18422
+ updatePixelRatio = () => {
18423
+ window.devicePixelRatio !== this.dpr && (this.dpr = window.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0));
18424
+ };
18425
+ matchMedia(mqString).addEventListener("change", updatePixelRatio);
18426
+ } catch (err) {
18427
+ return !1;
18428
+ }
18429
+ return !0;
18430
+ }
18431
+ deactivate(context) {
18432
+ const craf = application.global.getCancelAnimationFrame();
18433
+ craf && this.rafId && craf(this.rafId);
18434
+ }
18435
+ }
18436
+
18275
18437
  class IncrementalAutoRenderPlugin {
18276
18438
  constructor() {
18277
18439
  this.name = "IncrementalAutoRenderPlugin", this.activeEvent = "onRegister", this.nextFrameRenderGroupSet = new Set(), this.willNextFrameRender = !1, this.nextUserParams = {}, this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
@@ -18448,7 +18610,7 @@ class Stage extends Group {
18448
18610
  constructor() {
18449
18611
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18450
18612
  var _a;
18451
- super({}), this._onVisibleChange = visible => {
18613
+ super({}), this.tickedBeforeRender = !0, this._onVisibleChange = visible => {
18452
18614
  if (!(this._skipRender < 0)) if (visible) {
18453
18615
  if (this.dirtyBounds) {
18454
18616
  const b = this.window.getViewBox();
@@ -18459,7 +18621,10 @@ class Stage extends Group {
18459
18621
  }, this.beforeRender = stage => {
18460
18622
  this._beforeRender && this._beforeRender(stage);
18461
18623
  }, this.afterRender = stage => {
18462
- this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null;
18624
+ this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
18625
+ }, this.afterTickCb = () => {
18626
+ var _a;
18627
+ this.tickedBeforeRender = !0, "performance" === (null === (_a = this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) || "rendering" !== this.state && this.render();
18463
18628
  }, this.params = params, this.theme = new Theme(), this.hooks = {
18464
18629
  beforeRender: new SyncHook(["stage"]),
18465
18630
  afterRender: new SyncHook(["stage"])
@@ -18474,9 +18639,9 @@ class Stage extends Group {
18474
18639
  canvas: params.canvas
18475
18640
  }), 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(this, {
18476
18641
  main: !0
18477
- })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), 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({
18642
+ })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), 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({
18478
18643
  background: this._background
18479
- });
18644
+ }), this.ticker.on("afterTick", this.afterTickCb);
18480
18645
  }
18481
18646
  pauseRender() {
18482
18647
  let sr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
@@ -18609,6 +18774,14 @@ class Stage extends Group {
18609
18774
  this.pluginService.unRegister(plugin);
18610
18775
  }));
18611
18776
  }
18777
+ enableAutoRefresh() {
18778
+ this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
18779
+ }
18780
+ disableAutoRefresh() {
18781
+ this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
18782
+ this.pluginService.unRegister(plugin);
18783
+ }));
18784
+ }
18612
18785
  enableIncrementalAutoRender() {
18613
18786
  this.increaseAutoRender || (this.increaseAutoRender = !0, this.pluginService.register(new IncrementalAutoRenderPlugin()));
18614
18787
  }
@@ -18697,7 +18870,7 @@ class Stage extends Group {
18697
18870
  if ("released" === this.releaseStatus) return;
18698
18871
  this.ticker.start(), this.timeline.resume();
18699
18872
  const state = this.state;
18700
- 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++;
18873
+ this.state = "rendering", this.tickedBeforeRender || this.ticker.trySyncTickStatus(), 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++;
18701
18874
  }
18702
18875
  combineLayersToWindow() {
18703
18876
  if ("harmony" === this.global.env) {
@@ -18803,7 +18976,7 @@ class Stage extends Group {
18803
18976
  layer.release();
18804
18977
  }), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
18805
18978
  item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
18806
- }), this.interactiveLayer.release()), this.window.release(), this.ticker.remTimeline(this.timeline), this.renderService.renderTreeRoots = [];
18979
+ }), this.interactiveLayer.release()), this.window.release(), this.ticker.remTimeline(this.timeline), this.ticker.removeListener("afterTick", this.afterTickCb), this.renderService.renderTreeRoots = [];
18807
18980
  }
18808
18981
  setStage(stage) {}
18809
18982
  dirty(b, matrix) {
@@ -18881,8 +19054,6 @@ function createStage(params) {
18881
19054
  return new Stage(params);
18882
19055
  }
18883
19056
 
18884
- const strCommandMap = ["arc", "arcTo", "bezierCurveTo", "closePath", "ellipse", "lineTo", "moveTo", "quadraticCurveTo", "rect"];
18885
-
18886
19057
  var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
18887
19058
  var d,
18888
19059
  c = arguments.length,
@@ -19615,27 +19786,9 @@ function simplifyRadialDist(points, sqTolerance) {
19615
19786
  for (let i = 1, len = points.length; i < len; i++) deltaX = points[i].x - lastX, deltaY = points[i].y - lastY, deltaX * deltaX + deltaY * deltaY > sqTolerance && (lastX = points[i].x, lastY = points[i].y, newPoints.push(points[i]));
19616
19787
  return points[points.length - 1].x === lastX && points[points.length - 1].y === lastY || newPoints.push(points[points.length - 1]), newPoints;
19617
19788
  }
19618
- function simplifyDPStep(points, startIdx, endIdx, sqTolerance, simplified) {
19619
- let maxSqDist = sqTolerance,
19620
- nextIdx = startIdx;
19621
- const startX = points[startIdx].x,
19622
- startY = points[startIdx].y,
19623
- vecX2 = points[endIdx].x - startX,
19624
- vecY2 = points[endIdx].y - startY,
19625
- sqLength = vecX2 * vecX2 + vecY2 * vecY2;
19626
- let area, sqArea, sqDistance, vecX1, vecY1;
19627
- for (let i = startIdx + 1, len = endIdx - 1; i < len; i++) vecX1 = points[i].x - startX, vecY1 = points[i].y - startY, area = vecX1 * vecY2 - vecX2 * vecY1, sqArea = area * area, sqDistance = sqArea / sqLength, sqDistance > maxSqDist && (maxSqDist = sqDistance, nextIdx = i);
19628
- maxSqDist > sqTolerance && (nextIdx - startIdx > 2 && simplifyDPStep(points, startIdx, nextIdx, sqTolerance, simplified), simplified.push(points[nextIdx], points[nextIdx + 1]), endIdx - nextIdx > 2 && simplifyDPStep(points, nextIdx, endIdx, sqTolerance, simplified));
19629
- }
19630
- function simplifyDouglasPeucker(points, sqTolerance) {
19631
- const lastIdx = points.length - 1,
19632
- simplified = [points[0]];
19633
- return simplifyDPStep(points, 0, lastIdx, sqTolerance, simplified), simplified.push(points[lastIdx]), simplified;
19634
- }
19635
19789
  function flatten_simplify(points, tolerance, highestQuality) {
19636
19790
  if (points.length <= 10) return points;
19637
- const sqTolerance = void 0 !== tolerance ? tolerance * tolerance : 1;
19638
- return points = simplifyDouglasPeucker(points = highestQuality ? points : simplifyRadialDist(points, sqTolerance), sqTolerance);
19791
+ return points = highestQuality ? points : simplifyRadialDist(points, void 0 !== tolerance ? tolerance * tolerance : 1);
19639
19792
  }
19640
19793
 
19641
19794
  function findCursorIndexIgnoreLinebreak(textConfig, cursorIndex) {
@@ -23672,7 +23825,7 @@ class Gesture extends EventEmitter {
23672
23825
  let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23673
23826
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
23674
23827
  super(), this.cachedEvents = [], this.startPoints = [], this.processEvent = {}, this.throttleTimer = 0, this.emitThrottles = [], this.lastTapTarget = null, this.onStart = ev => {
23675
- this.reset(), this.startTime = clock.now();
23828
+ this.cachedEvents = [], this.startPoints = [], this.reset(), this.startTime = clock.now();
23676
23829
  const {
23677
23830
  cachedEvents: cachedEvents,
23678
23831
  startPoints: startPoints
@@ -23692,7 +23845,7 @@ class Gesture extends EventEmitter {
23692
23845
  if (1 !== startPoints.length) this.startDistance = calcDistance(startPoints[0], startPoints[1]), this.center = getCenter([startPoints[0], startPoints[1]]);else {
23693
23846
  const event = cachedEvents[0];
23694
23847
  this.pressTimeout = setTimeout(() => {
23695
- event.direction = "none", event.deltaX = 0, event.deltaY = 0, event.points = startPoints, this.triggerStartEvent("press", event), this.triggerEvent("press", event), this.eventType = "press", this.direction = "none";
23848
+ event.direction = "none", event.deltaX = 0, event.deltaY = 0, event.points = startPoints, this.triggerStartEvent("press", event), this.triggerEvent("press", event), this.eventType = "press", this.direction = "none", this.pressTimeout = null;
23696
23849
  }, this.config.press.time);
23697
23850
  }
23698
23851
  }, this.onMove = ev => {
@@ -23755,10 +23908,10 @@ class Gesture extends EventEmitter {
23755
23908
  lastMovePoint = this.lastMovePoint || startPoints[0],
23756
23909
  distance = calcDistance(prevMovePoint, lastMovePoint),
23757
23910
  velocity = distance / intervalTime;
23758
- velocity > this.config.swipe.velocity && distance > this.config.swipe.threshold && (endEvent.velocity = velocity, endEvent.direction = calcDirection(prevMovePoint, lastMovePoint), this.triggerEvent("swipe", endEvent));
23911
+ if (velocity > this.config.swipe.velocity && distance > this.config.swipe.threshold) return endEvent.velocity = velocity, endEvent.direction = calcDirection(prevMovePoint, lastMovePoint), this.triggerEvent("swipe", endEvent), this.cachedEvents = [], this.startPoints = [], void this.reset();
23759
23912
  }
23760
23913
  }
23761
- now - this.lastTapTime < this.config.tap.interval && ev.target === this.lastTapTarget ? this.tapCount++ : this.tapCount = 1, this.lastTapTime = now, this.lastTapTarget = ev.target, 1 === this.tapCount ? this.triggerEvent("tap", endEvent) : 2 === this.tapCount && (this.triggerEvent("doubletap", endEvent), this.tapCount = 0);
23914
+ now - this.startTime < this.config.press.time && (now - this.lastTapTime < this.config.tap.interval && ev.target === this.lastTapTarget ? this.tapCount++ : this.tapCount = 1, this.lastTapTime = now, this.lastTapTarget = ev.target, 1 === this.tapCount ? this.triggerEvent("tap", endEvent) : 2 === this.tapCount && (this.triggerEvent("doubletap", endEvent), this.tapCount = 0));
23762
23915
  }
23763
23916
  for (let i = 0, len = cachedEvents.length; i < len; i++) if (cachedEvents[i].pointerId === endEvent.pointerId) {
23764
23917
  cachedEvents.splice(i, 1), startPoints.splice(i, 1);
@@ -23800,7 +23953,7 @@ class Gesture extends EventEmitter {
23800
23953
  startTime: startTime,
23801
23954
  startPoints: startPoints
23802
23955
  } = this;
23803
- if (eventType) return eventType;
23956
+ if ("press" === eventType) return eventType;
23804
23957
  let type;
23805
23958
  return type = clock.now() - startTime > this.config.press.time && calcDistance(startPoints[0], point) < this.config.press.threshold ? "press" : "pan", this.eventType = type, type;
23806
23959
  }
@@ -23834,6 +23987,7 @@ class Gesture extends EventEmitter {
23834
23987
  emitThrottles: emitThrottles
23835
23988
  } = this;
23836
23989
  throttleTimer || (this.throttleTimer = application.global.getRequestAnimationFrame()(() => {
23990
+ application.global.getCancelAnimationFrame()(this.throttleTimer), this.throttleTimer = null;
23837
23991
  for (let i = 0, len = emitThrottles.length; i < len; i++) {
23838
23992
  const {
23839
23993
  type: type,
@@ -23841,7 +23995,7 @@ class Gesture extends EventEmitter {
23841
23995
  } = emitThrottles[i];
23842
23996
  this.emitEvent(type, ev);
23843
23997
  }
23844
- this.throttleTimer = 0, this.emitThrottles.length = 0;
23998
+ this.emitThrottles.length = 0;
23845
23999
  }));
23846
24000
  }
23847
24001
  triggerStartEvent(type, ev) {
@@ -24331,9 +24485,10 @@ let BrowserContext2d = class {
24331
24485
  lineJoin = defaultParams.lineJoin,
24332
24486
  lineDash = defaultParams.lineDash,
24333
24487
  lineCap = defaultParams.lineCap,
24334
- miterLimit = defaultParams.miterLimit
24488
+ miterLimit = defaultParams.miterLimit,
24489
+ keepStrokeScale = defaultParams.keepStrokeScale
24335
24490
  } = attribute;
24336
- _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
24491
+ _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
24337
24492
  }
24338
24493
  }
24339
24494
  setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
@@ -25233,8 +25388,9 @@ class PickerBase {
25233
25388
  return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, (context, arcAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, arcAttribute, themeAttribute) => {
25234
25389
  if (picked) return !0;
25235
25390
  const lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth,
25236
- pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
25237
- return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
25391
+ pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
25392
+ keepStrokeScale = arcAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
25393
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
25238
25394
  }), pickContext.highPerformanceRestore(), picked;
25239
25395
  }
25240
25396
  }
@@ -25507,8 +25663,9 @@ class RectPickerBase {
25507
25663
  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) => {
25508
25664
  if (picked) return !0;
25509
25665
  const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
25510
- pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
25511
- return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
25666
+ pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
25667
+ keepStrokeScale = rectAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
25668
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
25512
25669
  });else {
25513
25670
  const {
25514
25671
  fill = rectAttribute.fill,
@@ -25822,9 +25979,10 @@ let LynxContext2d = class extends BrowserContext2d {
25822
25979
  lineJoin = defaultParams.lineJoin,
25823
25980
  lineDash = defaultParams.lineDash,
25824
25981
  lineCap = defaultParams.lineCap,
25825
- miterLimit = defaultParams.miterLimit
25982
+ miterLimit = defaultParams.miterLimit,
25983
+ keepStrokeScale = defaultParams.keepStrokeScale
25826
25984
  } = attribute;
25827
- _context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
25985
+ _context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
25828
25986
  }
25829
25987
  }
25830
25988
  measureText(text) {
@@ -26452,9 +26610,10 @@ let TaroContext2d = class extends BrowserContext2d {
26452
26610
  lineJoin = defaultParams.lineJoin,
26453
26611
  lineDash = defaultParams.lineDash,
26454
26612
  lineCap = defaultParams.lineCap,
26455
- miterLimit = defaultParams.miterLimit
26613
+ miterLimit = defaultParams.miterLimit,
26614
+ keepStrokeScale = defaultParams.keepStrokeScale
26456
26615
  } = attribute;
26457
- _context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
26616
+ _context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
26458
26617
  }
26459
26618
  }
26460
26619
  setTextStyleWithoutAlignBaseline(params, defaultParams) {
@@ -27494,9 +27653,10 @@ let HarmonyContext2d = class extends BrowserContext2d {
27494
27653
  lineJoin = defaultParams.lineJoin,
27495
27654
  lineDash = defaultParams.lineDash,
27496
27655
  lineCap = defaultParams.lineCap,
27497
- miterLimit = defaultParams.miterLimit
27656
+ miterLimit = defaultParams.miterLimit,
27657
+ keepStrokeScale = defaultParams.keepStrokeScale
27498
27658
  } = attribute;
27499
- _context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
27659
+ _context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
27500
27660
  }
27501
27661
  }
27502
27662
  measureText(text) {
@@ -27903,8 +28063,9 @@ class BaseLinePicker extends BaseRender {
27903
28063
  return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, lineAttribute, themeAttribute) => {
27904
28064
  if (picked) return !0;
27905
28065
  const lineWidth = lineAttribute.lineWidth || themeAttribute.lineWidth,
27906
- pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
27907
- return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
28066
+ pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
28067
+ keepStrokeScale = lineAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
28068
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
27908
28069
  }), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
27909
28070
  }
27910
28071
  }
@@ -28039,8 +28200,9 @@ let DefaultCanvasSymbolPicker = class extends Base3dPicker {
28039
28200
  return this.canvasRenderer.drawShape(symbol, pickContext, x, y, {}, null, (context, symbolAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, symbolAttribute, themeAttribute) => {
28040
28201
  if (picked) return !0;
28041
28202
  const lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth,
28042
- pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
28043
- return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
28203
+ pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
28204
+ keepStrokeScale = symbolAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
28205
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
28044
28206
  }), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
28045
28207
  }
28046
28208
  };
@@ -28477,7 +28639,7 @@ const registerWrapText = _registerWrapText;
28477
28639
 
28478
28640
  const roughModule = _roughModule;
28479
28641
 
28480
- const version = "0.21.0-alpha.1";
28642
+ const version = "0.21.0-alpha.11";
28481
28643
  preLoadAllModule();
28482
28644
  if (isBrowserEnv()) {
28483
28645
  loadBrowserEnv(container);
@@ -28510,4 +28672,4 @@ registerReactAttributePlugin();
28510
28672
  registerDirectionalLight();
28511
28673
  registerOrthoCamera();
28512
28674
 
28513
- export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, BrowserEnvContribution, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasArc3dPicker, CanvasArcPicker, CanvasAreaPicker, CanvasCirclePicker, CanvasFactory, CanvasGlyphPicker, CanvasGroupPicker, CanvasImagePicker, CanvasLinePicker, CanvasPathPicker, CanvasPickerContribution, CanvasPolygonPicker, CanvasPyramid3dPicker, CanvasRect3dPicker, CanvasRectPicker, CanvasRichTextPicker, CanvasSymbolPicker, CanvasTextLayout, CanvasTextPicker, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageBackgroundRenderContribution, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DirectionalLight, DragNDrop, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, Fragment, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, Gesture, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MathArcPicker, MathAreaPicker, MathCirclePicker, MathGlyphPicker, MathImagePicker, MathLinePicker, MathPathPicker, MathPickerContribution, MathPolygonPicker, MathRectPicker, MathSymbolPicker, MathTextPicker, MatrixAllocate, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, REACT_TO_CANOPUS_EVENTS, REACT_TO_CANOPUS_EVENTS_LIST, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VArc, VArc3d, VArea, VCircle, VGlobal, VGlyph, VGroup, VImage, VLine, VPath, VPolygon, VPyramid3d, VRect, VRect3d, VRichText, VSymbol, VText, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _interpolateColor, _registerArc, addArcToBezierPath$1 as addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dCanvasPickModule, arc3dModule, arcCanvasPickModule, arcMathPickModule, arcModule, areaCanvasPickModule, areaMathPickModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, browserEnvModule, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleCanvasPickModule, circleMathPickModule, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createImageElement$1 as createImageElement, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, decodeReactDom, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawPathProxy, drawSegments, enumCommandMap, feishuEnvModule, fillVisible, findBestMorphingRotation, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, getAttributeFromDefaultAttrList, getConicGradientAt, getCurrentEnv, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphCanvasPickModule, glyphMathPickModule, glyphModule, graphicCreator, graphicService, graphicUtil, harmonyEnvModule, identityMat4, imageCanvasPickModule, imageMathPickModule, imageModule, incrementalAddTo, initAllEnv, initBrowserEnv, initFeishuEnv, initHarmonyEnv, initLynxEnv, initNodeEnv, initTTEnv, initTaroEnv, initWxEnv, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, jsx, layerService, lineCanvasPickModule, lineMathPickModule, lineModule, loadAllEnv, loadAllModule, loadBrowserEnv, loadFeishuEnv, loadHarmonyEnv, loadLynxEnv, loadNodeEnv, loadTTEnv, loadTaroEnv, loadWxEnv, lookAt, lynxEnvModule, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, nodeEnvModule, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathCanvasPickModule, pathMathPickModule, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonCanvasPickModule, polygonMathPickModule, polygonModule, preLoadAllModule, pyramid3dCanvasPickModule, pyramid3dModule, rafBasedSto, rect3dCanvasPickModule, rect3dModule, rectCanvasPickModule, rectFillVisible, rectMathPickModule, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc, registerArc3d, registerArc3dGraphic, registerArcGraphic, registerArea, registerAreaGraphic, registerCircle, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyph, registerGlyphGraphic, registerGroup, registerGroupGraphic, registerHtmlAttributePlugin, registerImage, registerImageGraphic, registerLine, registerLineGraphic, registerOrthoCamera, registerPath, registerPathGraphic, registerPolygon, registerPolygonGraphic, registerPyramid3d, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect, registerRect3d, registerRect3dGraphic, registerRectGraphic, registerRichtext, registerRichtextGraphic, registerShadowRoot, registerShadowRootGraphic, registerSymbol, registerSymbolGraphic, registerText, registerTextGraphic, registerViewTransform3dPlugin, registerWrapText, registerWrapTextGraphic, renderCommandList, rewriteProto, richTextMathPickModule, richtextCanvasPickModule, richtextModule, rotateX, rotateY, rotateZ, roughModule, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolCanvasPickModule, symbolMathPickModule, symbolModule, taroEnvModule, textAttributesToStyle, textCanvasPickModule, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textMathPickModule, textModule, transformKeys, transformMat4, transformUtil, translate, ttEnvModule, version, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, wxEnvModule, xul };
28675
+ export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, BrowserEnvContribution, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasArc3dPicker, CanvasArcPicker, CanvasAreaPicker, CanvasCirclePicker, CanvasFactory, CanvasGlyphPicker, CanvasGroupPicker, CanvasImagePicker, CanvasLinePicker, CanvasPathPicker, CanvasPickerContribution, CanvasPolygonPicker, CanvasPyramid3dPicker, CanvasRect3dPicker, CanvasRectPicker, CanvasRichTextPicker, CanvasSymbolPicker, CanvasTextLayout, CanvasTextPicker, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageBackgroundRenderContribution, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DirectionalLight, DragNDrop, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, Fragment, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, Gesture, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MathArcPicker, MathAreaPicker, MathCirclePicker, MathGlyphPicker, MathImagePicker, MathLinePicker, MathPathPicker, MathPickerContribution, MathPolygonPicker, MathRectPicker, MathSymbolPicker, MathTextPicker, MatrixAllocate, MeasureModeEnum, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, REACT_TO_CANOPUS_EVENTS, REACT_TO_CANOPUS_EVENTS_LIST, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VArc, VArc3d, VArea, VCircle, VGlobal, VGlyph, VGroup, VImage, VLine, VPath, VPolygon, VPyramid3d, VRect, VRect3d, VRichText, VSymbol, VText, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _interpolateColor, _registerArc, addArcToBezierPath$1 as addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dCanvasPickModule, arc3dModule, arcCanvasPickModule, arcMathPickModule, arcModule, areaCanvasPickModule, areaMathPickModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, browserEnvModule, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleCanvasPickModule, circleMathPickModule, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createImageElement$1 as createImageElement, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, decodeReactDom, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawPathProxy, drawSegments, enumCommandMap, feishuEnvModule, fillVisible, findBestMorphingRotation, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, getAttributeFromDefaultAttrList, getConicGradientAt, getCurrentEnv, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphCanvasPickModule, glyphMathPickModule, glyphModule, graphicCreator, graphicService, graphicUtil, harmonyEnvModule, identityMat4, imageCanvasPickModule, imageMathPickModule, imageModule, incrementalAddTo, initAllEnv, initBrowserEnv, initFeishuEnv, initHarmonyEnv, initLynxEnv, initNodeEnv, initTTEnv, initTaroEnv, initWxEnv, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, jsx, layerService, lineCanvasPickModule, lineMathPickModule, lineModule, loadAllEnv, loadAllModule, loadBrowserEnv, loadFeishuEnv, loadHarmonyEnv, loadLynxEnv, loadNodeEnv, loadTTEnv, loadTaroEnv, loadWxEnv, lookAt, lynxEnvModule, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, nodeEnvModule, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathCanvasPickModule, pathMathPickModule, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonCanvasPickModule, polygonMathPickModule, polygonModule, preLoadAllModule, pyramid3dCanvasPickModule, pyramid3dModule, rafBasedSto, rect3dCanvasPickModule, rect3dModule, rectCanvasPickModule, rectFillVisible, rectMathPickModule, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc, registerArc3d, registerArc3dGraphic, registerArcGraphic, registerArea, registerAreaGraphic, registerCircle, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyph, registerGlyphGraphic, registerGroup, registerGroupGraphic, registerHtmlAttributePlugin, registerImage, registerImageGraphic, registerLine, registerLineGraphic, registerOrthoCamera, registerPath, registerPathGraphic, registerPolygon, registerPolygonGraphic, registerPyramid3d, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect, registerRect3d, registerRect3dGraphic, registerRectGraphic, registerRichtext, registerRichtextGraphic, registerShadowRoot, registerShadowRootGraphic, registerSymbol, registerSymbolGraphic, registerText, registerTextGraphic, registerViewTransform3dPlugin, registerWrapText, registerWrapTextGraphic, renderCommandList, rewriteProto, richTextMathPickModule, richtextCanvasPickModule, richtextModule, rotateX, rotateY, rotateZ, roughModule, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolCanvasPickModule, symbolMathPickModule, symbolModule, taroEnvModule, textAttributesToStyle, textCanvasPickModule, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textMathPickModule, textModule, transformKeys, transformMat4, transformUtil, translate, ttEnvModule, version, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, wxEnvModule, xul };