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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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,8 @@ 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
3939
3955
  };
3940
3956
  const DefaultPickStyle = {
3941
3957
  pickStrokeBuffer: 0
@@ -3979,6 +3995,7 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
3979
3995
  zIndex: 0,
3980
3996
  layout: null,
3981
3997
  boundsPadding: 0,
3998
+ fillStrokeOrder: 0,
3982
3999
  renderStyle: "default",
3983
4000
  pickMode: "accurate",
3984
4001
  customPickShape: null,
@@ -3988,7 +4005,8 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
3988
4005
  globalZIndex: 1,
3989
4006
  globalCompositeOperation: "",
3990
4007
  overflow: "hidden",
3991
- shadowPickMode: "graphic"
4008
+ shadowPickMode: "graphic",
4009
+ keepStrokeScale: !1
3992
4010
  }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
3993
4011
  function addAttributeToPrototype(obj, c, keys) {
3994
4012
  keys.forEach(key => {
@@ -4057,6 +4075,7 @@ const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, Defau
4057
4075
  });
4058
4076
  const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
4059
4077
  path: new CustomPath2D(),
4078
+ fillStrokeOrder: 1,
4060
4079
  customPath: () => {
4061
4080
  Logger.getInstance().warn("空函数");
4062
4081
  }
@@ -4262,10 +4281,32 @@ let ATextMeasure = class {
4262
4281
  configure(service, env) {
4263
4282
  this.canvas = service.canvas, this.context = service.context, service.bindTextMeasure(this);
4264
4283
  }
4265
- measureTextWidth(text, options) {
4266
- if (!this.context) return this.estimate(text, options).width;
4284
+ _measureTextWithoutAlignBaseline(text, options, compatible) {
4267
4285
  this.context.setTextStyleWithoutAlignBaseline(options);
4268
- return this.context.measureText(text).width;
4286
+ const metrics = this.context.measureText(text);
4287
+ return compatible ? this.compatibleMetrics(metrics, options) : metrics;
4288
+ }
4289
+ _measureTextWithAlignBaseline(text, options, compatible) {
4290
+ this.context.setTextStyle(options);
4291
+ const metrics = this.context.measureText(text);
4292
+ return compatible ? this.compatibleMetrics(metrics, options) : metrics;
4293
+ }
4294
+ compatibleMetrics(metrics, options) {
4295
+ if (null == metrics.actualBoundingBoxAscent || null == metrics.actualBoundingBoxDescent || null == metrics.fontBoundingBoxAscent || null == metrics.fontBoundingBoxDescent) {
4296
+ const {
4297
+ ascent: ascent,
4298
+ descent: descent
4299
+ } = this.measureTextBoundADscentEstimate(options);
4300
+ metrics.actualBoundingBoxAscent = ascent, metrics.actualBoundingBoxDescent = descent, metrics.fontBoundingBoxAscent = ascent, metrics.fontBoundingBoxDescent = descent;
4301
+ }
4302
+ if (null == metrics.actualBoundingBoxLeft || null == metrics.actualBoundingBoxRight) {
4303
+ const {
4304
+ left: left,
4305
+ right: right
4306
+ } = this.measureTextBoundLeftRightEstimate(options);
4307
+ metrics.actualBoundingBoxLeft = left, metrics.actualBoundingBoxRight = right;
4308
+ }
4309
+ return metrics;
4269
4310
  }
4270
4311
  estimate(text, _ref) {
4271
4312
  let {
@@ -4279,19 +4320,97 @@ let ATextMeasure = class {
4279
4320
  height: fontSize
4280
4321
  };
4281
4322
  }
4282
- measureTextPixelHeight(text, options) {
4323
+ measureTextWidth(text, options, textMeasure) {
4324
+ return this.context ? (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithoutAlignBaseline(text, options)).width : this.estimate(text, options).width;
4325
+ }
4326
+ measureTextBoundsWidth(text, options, textMeasure) {
4327
+ return this.context ? (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithoutAlignBaseline(text, options)).width : this.estimate(text, options).width;
4328
+ }
4329
+ measureTextBoundsLeftRight(text, options, textMeasure) {
4330
+ return this.context ? {
4331
+ left: (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithAlignBaseline(text, options, !0)).actualBoundingBoxLeft,
4332
+ right: textMeasure.actualBoundingBoxRight
4333
+ } : this.measureTextBoundLeftRightEstimate(options);
4334
+ }
4335
+ measureTextPixelHeight(text, options, textMeasure) {
4283
4336
  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);
4337
+ 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
4338
  }
4289
- measureTextBoundHieght(text, options) {
4339
+ measureTextPixelADscent(text, options, textMeasure) {
4340
+ return this.context ? {
4341
+ ascent: (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithAlignBaseline(text, options, !0)).actualBoundingBoxAscent,
4342
+ descent: textMeasure.actualBoundingBoxDescent
4343
+ } : this.measureTextBoundADscentEstimate(options);
4344
+ }
4345
+ measureTextBoundHieght(text, options, textMeasure) {
4290
4346
  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);
4347
+ 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;
4348
+ }
4349
+ measureTextBoundADscent(text, options, textMeasure) {
4350
+ return this.context ? {
4351
+ ascent: (textMeasure = null != textMeasure ? textMeasure : this._measureTextWithAlignBaseline(text, options, !0)).fontBoundingBoxAscent,
4352
+ descent: textMeasure.fontBoundingBoxDescent
4353
+ } : this.measureTextBoundADscentEstimate(options);
4354
+ }
4355
+ measureTextBoundADscentEstimate(options) {
4356
+ var _a;
4357
+ const fontSize = null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize;
4358
+ return {
4359
+ ascent: .79 * fontSize,
4360
+ descent: .21 * fontSize
4361
+ };
4362
+ }
4363
+ measureTextBoundLeftRightEstimate(options) {
4364
+ var _a;
4365
+ const fontSize = null !== (_a = options.fontSize) && void 0 !== _a ? _a : DefaultTextStyle.fontSize,
4366
+ {
4367
+ textAlign: textAlign
4368
+ } = options;
4369
+ return "center" === textAlign ? {
4370
+ left: fontSize / 2,
4371
+ right: fontSize / 2
4372
+ } : "right" === textAlign || "end" === textAlign ? {
4373
+ left: fontSize,
4374
+ right: 0
4375
+ } : {
4376
+ left: 0,
4377
+ right: fontSize
4378
+ };
4379
+ }
4380
+ measureTextPixelADscentAndWidth(text, options, mode) {
4381
+ if (!this.context) return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), {
4382
+ width: this.estimate(text, options).width
4383
+ });
4384
+ const out = this._measureTextWithoutAlignBaseline(text, options, !0);
4385
+ if (mode === MeasureModeEnum.actualBounding) return {
4386
+ ascent: out.actualBoundingBoxAscent,
4387
+ descent: out.actualBoundingBoxDescent,
4388
+ width: out.width
4389
+ };
4390
+ if (mode === MeasureModeEnum.estimate) return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), {
4391
+ width: out.width
4392
+ });
4393
+ if (mode === MeasureModeEnum.fontBounding) {
4394
+ let ascent = out.fontBoundingBoxAscent,
4395
+ descent = out.fontBoundingBoxDescent;
4396
+ if (out.actualBoundingBoxDescent && descent < out.actualBoundingBoxDescent) {
4397
+ const delta = out.actualBoundingBoxDescent - descent;
4398
+ descent += delta, ascent -= delta;
4399
+ } else if (out.actualBoundingBoxAscent && ascent < out.actualBoundingBoxAscent) {
4400
+ const delta = out.actualBoundingBoxAscent - ascent;
4401
+ ascent += delta, descent -= delta;
4402
+ }
4403
+ return {
4404
+ ascent: ascent,
4405
+ descent: descent,
4406
+ width: out.width
4407
+ };
4408
+ }
4409
+ return {
4410
+ ascent: out.actualBoundingBoxAscent,
4411
+ descent: out.actualBoundingBoxDescent,
4412
+ width: out.width
4413
+ };
4295
4414
  }
4296
4415
  measureText(text, options) {
4297
4416
  return this.context ? (this.context.setTextStyleWithoutAlignBaseline(options), this.context.measureText(text)) : this.estimate(text, options);
@@ -4369,6 +4488,14 @@ let ATextMeasure = class {
4369
4488
  return data;
4370
4489
  }
4371
4490
  _clipTextEnd(text, options, width, leftIdx, rightIdx) {
4491
+ if (leftIdx === rightIdx) {
4492
+ Logger.getInstance().warn(`【_clipTextEnd】不应该走到这里${text}, ${leftIdx}, ${rightIdx}`);
4493
+ const subText = text.substring(0, rightIdx + 1);
4494
+ return {
4495
+ str: subText,
4496
+ width: this.measureTextWidth(subText, options)
4497
+ };
4498
+ }
4372
4499
  const middleIdx = Math.floor((leftIdx + rightIdx) / 2),
4373
4500
  subText = text.substring(0, middleIdx + 1),
4374
4501
  strWidth = this.measureTextWidth(subText, options);
@@ -4402,7 +4529,7 @@ let ATextMeasure = class {
4402
4529
  }
4403
4530
  _clipTextStart(text, options, width, leftIdx, rightIdx) {
4404
4531
  const middleIdx = Math.ceil((leftIdx + rightIdx) / 2),
4405
- subText = text.substring(middleIdx - 1, text.length - 1),
4532
+ subText = text.substring(middleIdx - 1, text.length),
4406
4533
  strWidth = this.measureTextWidth(subText, options);
4407
4534
  let length;
4408
4535
  if (strWidth > width) {
@@ -4410,18 +4537,18 @@ let ATextMeasure = class {
4410
4537
  str: "",
4411
4538
  width: 0
4412
4539
  };
4413
- const str = text.substring(middleIdx, text.length - 1);
4540
+ const str = text.substring(middleIdx, text.length);
4414
4541
  return length = this.measureTextWidth(str, options), length <= width ? {
4415
4542
  str: str,
4416
4543
  width: length
4417
- } : this._clipTextStart(text, options, width, middleIdx, text.length - 1);
4544
+ } : this._clipTextStart(text, options, width, middleIdx, text.length);
4418
4545
  }
4419
4546
  if (strWidth < width) {
4420
4547
  if (middleIdx <= 0) return {
4421
4548
  str: text,
4422
4549
  width: this.measureTextWidth(text, options)
4423
4550
  };
4424
- const str = text.substring(middleIdx - 2, text.length - 1);
4551
+ const str = text.substring(middleIdx - 2, text.length);
4425
4552
  return length = this.measureTextWidth(str, options), length >= width ? {
4426
4553
  str: subText,
4427
4554
  width: strWidth
@@ -5082,7 +5209,7 @@ let DefaultWindow = class {
5082
5209
  }
5083
5210
  hasSubView() {
5084
5211
  const viewBox = this._handler.getViewBox();
5085
- return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width === viewBox.width() && this.height === viewBox.height());
5212
+ return !(0 === viewBox.x1 && 0 === viewBox.y1 && isNumberClose(this.width, viewBox.width()) && isNumberClose(this.height, viewBox.height()));
5086
5213
  }
5087
5214
  isVisible(bbox) {
5088
5215
  return this._handler.isVisible(bbox);
@@ -6006,7 +6133,7 @@ class EventManager {
6006
6133
  timeStamp: now
6007
6134
  });
6008
6135
  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);
6136
+ 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
6137
  }
6011
6138
  this.freeEvent(e);
6012
6139
  }, this.onPointerUpOutside = (from, target) => {
@@ -6223,7 +6350,8 @@ class EventSystem {
6223
6350
  supportsPointerEvents = global.supportsPointerEvents
6224
6351
  } = params;
6225
6352
  this.manager = new EventManager(rootNode, {
6226
- clickInterval: clickInterval
6353
+ clickInterval: clickInterval,
6354
+ supportsTouchEvents: supportsTouchEvents
6227
6355
  }), 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
6356
  default: "inherit",
6229
6357
  pointer: "pointer"
@@ -6394,7 +6522,7 @@ class TimeOutTickHandler {
6394
6522
  }
6395
6523
  }
6396
6524
 
6397
- class DefaultTicker {
6525
+ class DefaultTicker extends EventEmitter {
6398
6526
  set mode(m) {
6399
6527
  this._mode !== m && (this._mode = m, this.setupTickHandler());
6400
6528
  }
@@ -6403,17 +6531,17 @@ class DefaultTicker {
6403
6531
  }
6404
6532
  constructor() {
6405
6533
  let timelines = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6406
- this.handleTick = (handler, params) => {
6534
+ super(), this.handleTick = (handler, params) => {
6407
6535
  const {
6408
6536
  once = !1
6409
6537
  } = null != params ? params : {};
6410
- this.ifCanStop() ? this.stop() : (this._handlerTick(handler), once || handler.tick(this.interval, this.handleTick));
6411
- }, this._handlerTick = handler => {
6538
+ this.ifCanStop() ? this.stop() : (this._handlerTick(), once || handler.tick(this.interval, this.handleTick));
6539
+ }, this._handlerTick = () => {
6412
6540
  const time = this.tickerHandler.getTime();
6413
6541
  let delta = 0;
6414
6542
  this.lastFrameTime >= 0 && (delta = time - this.lastFrameTime), this.lastFrameTime = time, this.status === STATUS$1.RUNNING && (this.tickCounts++, this.timelines.forEach(t => {
6415
6543
  t.tick(delta);
6416
- }));
6544
+ }), this.emit("afterTick"));
6417
6545
  }, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.timelines = timelines, this.autoStop = !0;
6418
6546
  }
6419
6547
  init() {
@@ -6509,6 +6637,9 @@ class DefaultTicker {
6509
6637
  stop() {
6510
6638
  this.status = STATUS$1.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
6511
6639
  }
6640
+ trySyncTickStatus() {
6641
+ this.status === STATUS$1.RUNNING && this._handlerTick();
6642
+ }
6512
6643
  }
6513
6644
 
6514
6645
  class ManualTickHandler {
@@ -7650,7 +7781,7 @@ class TagPointsUpdate extends ACustomAnimate {
7650
7781
  lastMatchedIndex = i, lastMatchedPoint = tagMap.get(this.toPoints[i].context);
7651
7782
  break;
7652
7783
  }
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);
7784
+ "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
7785
  let prevMatchedPoint = this.toPoints[0];
7655
7786
  this.interpolatePoints = this.toPoints.map((point, index) => {
7656
7787
  const matchedPoint = tagMap.get(point.context);
@@ -7662,11 +7793,19 @@ class TagPointsUpdate extends ACustomAnimate {
7662
7793
  return newPoint.defined = toPoint.defined, newPoint.context = toPoint.context, newPoint;
7663
7794
  });
7664
7795
  }
7796
+ onFirstRun() {
7797
+ const lastClipRange = this.target.attribute.clipRange;
7798
+ isValidNumber$1(lastClipRange * this.clipRange) && (this.clipRange *= lastClipRange);
7799
+ }
7665
7800
  onUpdate(end, ratio, out) {
7666
7801
  if (this.points = this.points.map((point, index) => {
7667
7802
  const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
7668
7803
  return newPoint.context = point.context, newPoint;
7669
- }), this.clipRange && (out.clipRange = this.clipRange + (1 - this.clipRange) * ratio), this.segmentsCache && this.to.segments) {
7804
+ }), this.clipRange) {
7805
+ 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));
7806
+ out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
7807
+ }
7808
+ if (this.segmentsCache && this.to.segments) {
7670
7809
  let start = 0;
7671
7810
  out.segments = this.to.segments.map((segment, index) => {
7672
7811
  const end = start + this.segmentsCache[index],
@@ -12020,7 +12159,8 @@ class DefaultArcRenderContribution {
12020
12159
  x: originX = arcAttribute.x,
12021
12160
  y: originY = arcAttribute.y,
12022
12161
  scaleX = arcAttribute.scaleX,
12023
- scaleY = arcAttribute.scaleY
12162
+ scaleY = arcAttribute.scaleY,
12163
+ keepStrokeScale = arcAttribute.keepStrokeScale
12024
12164
  } = arc.attribute;
12025
12165
  let {
12026
12166
  innerRadius = arcAttribute.innerRadius,
@@ -12032,7 +12172,7 @@ class DefaultArcRenderContribution {
12032
12172
  {
12033
12173
  distance = arcAttribute[key].distance
12034
12174
  } = borderStyle,
12035
- d = getScaledStroke(context, distance, context.dpr),
12175
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12036
12176
  deltaAngle = distance / outerRadius,
12037
12177
  sign = "outerBorder" === key ? 1 : -1;
12038
12178
  if (arc.setAttributes({
@@ -12077,14 +12217,15 @@ class DefaultCircleRenderContribution {
12077
12217
  x: originX = circleAttribute.x,
12078
12218
  y: originY = circleAttribute.y,
12079
12219
  scaleX = circleAttribute.scaleX,
12080
- scaleY = circleAttribute.scaleY
12220
+ scaleY = circleAttribute.scaleY,
12221
+ keepStrokeScale = circleAttribute.keepStrokeScale
12081
12222
  } = circle.attribute,
12082
12223
  renderBorder = (borderStyle, key) => {
12083
12224
  const doStroke = !(!borderStyle || !borderStyle.stroke),
12084
12225
  {
12085
12226
  distance = circleAttribute[key].distance
12086
12227
  } = borderStyle,
12087
- d = getScaledStroke(context, distance, context.dpr),
12228
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12088
12229
  sign = "outerBorder" === key ? 1 : -1;
12089
12230
  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
12231
  const lastOpacity = circleAttribute[key].opacity;
@@ -12203,7 +12344,8 @@ class DefaultRectRenderContribution {
12203
12344
  scaleX = rectAttribute.scaleX,
12204
12345
  scaleY = rectAttribute.scaleY,
12205
12346
  x1: x1,
12206
- y1: y1
12347
+ y1: y1,
12348
+ keepStrokeScale = rectAttribute.keepStrokeScale
12207
12349
  } = rect.attribute;
12208
12350
  let {
12209
12351
  width: width,
@@ -12216,7 +12358,7 @@ class DefaultRectRenderContribution {
12216
12358
  {
12217
12359
  distance = rectAttribute[key].distance
12218
12360
  } = borderStyle,
12219
- d = getScaledStroke(context, distance, context.dpr),
12361
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12220
12362
  nextX = x + sign * d,
12221
12363
  nextY = y + sign * d,
12222
12364
  dw = 2 * d;
@@ -12373,14 +12515,15 @@ class DefaultSymbolRenderContribution {
12373
12515
  x: originX = symbolAttribute.x,
12374
12516
  y: originY = symbolAttribute.y,
12375
12517
  scaleX = symbolAttribute.scaleX,
12376
- scaleY = symbolAttribute.scaleY
12518
+ scaleY = symbolAttribute.scaleY,
12519
+ keepStrokeScale = symbolAttribute.keepStrokeScale
12377
12520
  } = symbol.attribute,
12378
12521
  renderBorder = (borderStyle, key) => {
12379
12522
  const doStroke = !(!borderStyle || !borderStyle.stroke),
12380
12523
  {
12381
12524
  distance = symbolAttribute[key].distance
12382
12525
  } = borderStyle,
12383
- d = getScaledStroke(context, distance, context.dpr),
12526
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12384
12527
  sign = "outerBorder" === key ? 1 : -1;
12385
12528
  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
12529
  const lastOpacity = symbolAttribute[key].opacity;
@@ -12500,7 +12643,8 @@ let DefaultCanvasArcRender = class extends BaseRender {
12500
12643
  fill = arcAttribute.fill,
12501
12644
  stroke = arcAttribute.stroke,
12502
12645
  x: originX = arcAttribute.x,
12503
- y: originY = arcAttribute.y
12646
+ y: originY = arcAttribute.y,
12647
+ fillStrokeOrder = arcAttribute.fillStrokeOrder
12504
12648
  } = arc.attribute,
12505
12649
  data = this.valid(arc, arcAttribute, fillCb, strokeCb);
12506
12650
  if (!data) return;
@@ -12536,7 +12680,17 @@ let DefaultCanvasArcRender = class extends BaseRender {
12536
12680
  isFullStroke: isFullStroke,
12537
12681
  stroke: arrayStroke
12538
12682
  } = 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) {
12683
+ if (doFill || isFullStroke) {
12684
+ 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);
12685
+ const _runFill = () => {
12686
+ doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill()));
12687
+ },
12688
+ _runStroke = () => {
12689
+ doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.stroke()));
12690
+ };
12691
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
12692
+ }
12693
+ if (!isFullStroke && doStroke) {
12540
12694
  context.beginPath();
12541
12695
  drawArcPath$1(arc, context, x, y, outerRadius, innerRadius, arrayStroke);
12542
12696
  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 +12708,20 @@ let DefaultCanvasArcRender = class extends BaseRender {
12554
12708
  fill = arcAttribute.fill
12555
12709
  } = arc.attribute,
12556
12710
  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()));
12711
+ 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);
12712
+ const _runFill = () => {
12713
+ if (doFill) {
12714
+ const color = fill;
12715
+ if ("conical" === color.gradient) {
12716
+ const lastColor = getConicGradientAt(0, 0, endAngle, color);
12717
+ fillCb || fillVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = lastColor, context.fill());
12718
+ }
12719
+ }
12720
+ },
12721
+ _runStroke = () => {
12722
+ doStroke && (strokeCb || sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()));
12723
+ };
12724
+ _runFill(), _runStroke();
12565
12725
  }
12566
12726
  }
12567
12727
  this.afterRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), tempChangeConicalColor && (fill.startAngle += conicalOffset, fill.endAngle += conicalOffset);
@@ -12599,7 +12759,8 @@ let DefaultCanvasCircleRender = class extends BaseRender {
12599
12759
  startAngle = circleAttribute.startAngle,
12600
12760
  endAngle = circleAttribute.endAngle,
12601
12761
  x: originX = circleAttribute.x,
12602
- y: originY = circleAttribute.y
12762
+ y: originY = circleAttribute.y,
12763
+ fillStrokeOrder = circleAttribute.fillStrokeOrder
12603
12764
  } = circle.attribute,
12604
12765
  data = this.valid(circle, circleAttribute, fillCb, strokeCb);
12605
12766
  if (!data) return;
@@ -12609,7 +12770,14 @@ let DefaultCanvasCircleRender = class extends BaseRender {
12609
12770
  doFill: doFill,
12610
12771
  doStroke: doStroke
12611
12772
  } = 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);
12773
+ 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);
12774
+ const _runFill = () => {
12775
+ doFill && (fillCb ? fillCb(context, circle.attribute, circleAttribute) : fVisible && (context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.fill()));
12776
+ },
12777
+ _runStroke = () => {
12778
+ doStroke && (strokeCb ? strokeCb(context, circle.attribute, circleAttribute) : sVisible && (context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.stroke()));
12779
+ };
12780
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
12613
12781
  }
12614
12782
  draw(circle, renderService, drawContext, params) {
12615
12783
  const circleAttribute = getTheme(circle, null == params ? void 0 : params.theme).circle;
@@ -13050,7 +13218,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13050
13218
  super(), this.areaRenderContribitions = areaRenderContribitions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(areaRenderContribitions);
13051
13219
  }
13052
13220
  drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
13053
- var _a, _b, _c, _d, _e;
13221
+ var _a, _b, _c;
13054
13222
  const {
13055
13223
  points: points
13056
13224
  } = area.attribute;
@@ -13074,28 +13242,31 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13074
13242
  x: originX = 0,
13075
13243
  x: originY = 0
13076
13244
  } = 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, {
13245
+ !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
13246
  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);
13247
+ }), (() => {
13248
+ var _a, _b;
13249
+ if (stroke) {
13250
+ const {
13251
+ stroke = areaAttribute && areaAttribute.stroke
13252
+ } = area.attribute;
13253
+ if (isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
13254
+ context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
13255
+ for (let i = 1; i < points.length; i++) {
13256
+ const p = points[i];
13257
+ context.lineTo(p.x + offsetX, p.y + offsetY, z);
13258
+ }
13259
+ } else if (stroke[2]) {
13260
+ const endP = points[points.length - 1];
13261
+ context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
13262
+ for (let i = points.length - 2; i >= 0; i--) {
13263
+ const p = points[i];
13264
+ 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);
13265
+ }
13095
13266
  }
13267
+ strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
13096
13268
  }
13097
- strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
13098
- }
13269
+ })();
13099
13270
  }
13100
13271
  drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
13101
13272
  var _a, _b, _c, _d, _e, _f;
@@ -13260,23 +13431,24 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13260
13431
  x: originX = 0,
13261
13432
  x: originY = 0
13262
13433
  } = 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, {
13434
+ 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
13435
  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;
13436
+ }), (() => {
13437
+ if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
13438
+ const {
13439
+ stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
13440
+ } = attribute;
13441
+ 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", {
13442
+ offsetX: offsetX,
13443
+ offsetY: offsetY,
13444
+ offsetZ: offsetZ,
13445
+ drawConnect: connect,
13446
+ mode: connectedType,
13447
+ zeroX: connectedX,
13448
+ zeroY: connectedY
13449
+ })), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
13450
+ }
13451
+ })(), !1;
13280
13452
  }
13281
13453
  };
13282
13454
  DefaultCanvasAreaRender = __decorate$1v([injectable(), __param$N(0, inject(ContributionProvider)), __param$N(0, named(AreaRenderContribution)), __metadata$19("design:paramtypes", [Object])], DefaultCanvasAreaRender);
@@ -13308,7 +13480,8 @@ let DefaultCanvasPathRender = class extends BaseRender {
13308
13480
  const pathAttribute = null !== (_a = this.tempTheme) && void 0 !== _a ? _a : getTheme(path, null == params ? void 0 : params.theme).path,
13309
13481
  {
13310
13482
  x: originX = pathAttribute.x,
13311
- y: originY = pathAttribute.y
13483
+ y: originY = pathAttribute.y,
13484
+ fillStrokeOrder = pathAttribute.fillStrokeOrder
13312
13485
  } = path.attribute,
13313
13486
  z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
13314
13487
  data = this.valid(path, pathAttribute, fillCb, strokeCb);
@@ -13323,7 +13496,14 @@ let DefaultCanvasPathRender = class extends BaseRender {
13323
13496
  const path2D = null !== (_c = path.attribute.path) && void 0 !== _c ? _c : pathAttribute.path;
13324
13497
  renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
13325
13498
  }
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);
13499
+ context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
13500
+ const _runStroke = () => {
13501
+ doStroke && (strokeCb ? strokeCb(context, path.attribute, pathAttribute) : sVisible && (context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.stroke()));
13502
+ },
13503
+ _runFill = () => {
13504
+ doFill && (fillCb ? fillCb(context, path.attribute, pathAttribute) : fVisible && (context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.fill()));
13505
+ };
13506
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
13327
13507
  }
13328
13508
  draw(path, renderService, drawContext, params) {
13329
13509
  const pathAttribute = getTheme(path, null == params ? void 0 : params.theme).path;
@@ -13367,7 +13547,8 @@ let DefaultCanvasRectRender = class extends BaseRender {
13367
13547
  x1: x1,
13368
13548
  y1: y1,
13369
13549
  x: originX = rectAttribute.x,
13370
- y: originY = rectAttribute.y
13550
+ y: originY = rectAttribute.y,
13551
+ fillStrokeOrder = rectAttribute.fillStrokeOrder
13371
13552
  } = rect.attribute;
13372
13553
  let {
13373
13554
  width: width,
@@ -13386,7 +13567,14 @@ let DefaultCanvasRectRender = class extends BaseRender {
13386
13567
  doFill: doFill,
13387
13568
  doStroke: doStroke
13388
13569
  };
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);
13570
+ context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
13571
+ const _runFill = () => {
13572
+ doFillOrStroke.doFill && (fillCb ? fillCb(context, rect.attribute, rectAttribute) : fVisible && (context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.fill()));
13573
+ },
13574
+ _runStroke = () => {
13575
+ doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, rect.attribute, rectAttribute) : sVisible && (context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.stroke()));
13576
+ };
13577
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
13390
13578
  }
13391
13579
  draw(rect, renderService, drawContext, params) {
13392
13580
  const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect;
@@ -13422,7 +13610,8 @@ let DefaultCanvasSymbolRender = class extends BaseRender {
13422
13610
  x: originX = symbolAttribute.x,
13423
13611
  y: originY = symbolAttribute.y,
13424
13612
  scaleX = symbolAttribute.scaleX,
13425
- scaleY = symbolAttribute.scaleY
13613
+ scaleY = symbolAttribute.scaleY,
13614
+ fillStrokeOrder = symbolAttribute.fillStrokeOrder
13426
13615
  } = symbol.attribute,
13427
13616
  data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);
13428
13617
  if (!data) return;
@@ -13445,14 +13634,27 @@ let DefaultCanvasSymbolRender = class extends BaseRender {
13445
13634
  const obj = Object.assign({}, a);
13446
13635
  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
13636
  }
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()));
13637
+ const _runFill = () => {
13638
+ a.fill && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : (context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute), context.fill()));
13639
+ },
13640
+ _runStroke = () => {
13641
+ a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
13642
+ };
13643
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
13449
13644
  };
13450
13645
  if (keepDirIn3d && context.camera && context.project) {
13451
13646
  const p = context.project(x, y, z),
13452
13647
  camera = context.camera;
13453
13648
  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
13649
  } 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);
13650
+ context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
13651
+ const _runFill = () => {
13652
+ doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill()));
13653
+ },
13654
+ _runStroke = () => {
13655
+ doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
13656
+ };
13657
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
13456
13658
  }
13457
13659
  draw(symbol, renderService, drawContext, params) {
13458
13660
  const symbolAttribute = getTheme(symbol, null == params ? void 0 : params.theme).symbol;
@@ -13599,16 +13801,8 @@ let DefaultCanvasTextRender = class extends BaseRender {
13599
13801
  verticalMode = textAttribute.verticalMode,
13600
13802
  x: originX = textAttribute.x,
13601
13803
  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,
13804
+ } = text.attribute,
13805
+ lineHeight = null !== (_a = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _a ? _a : fontSize,
13612
13806
  data = this.valid(text, textAttribute, fillCb, strokeCb);
13613
13807
  if (!data) return;
13614
13808
  const {
@@ -13628,79 +13822,60 @@ let DefaultCanvasTextRender = class extends BaseRender {
13628
13822
  const matrix = matrixAllocate.allocate(1, 0, 0, 1, 0, 0);
13629
13823
  matrix.rotateByCenter(Math.PI / 2, _x, _y), context.transformFromMatrix(matrix, !0), matrixAllocate.free(matrix);
13630
13824
  }
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());
13825
+ 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
13826
  };
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
- });
13827
+ if (context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z), "horizontal" === direction) {
13828
+ const {
13829
+ multilineLayout: multilineLayout
13830
+ } = text;
13831
+ if (!multilineLayout) return void context.highPerformanceRestore();
13832
+ const {
13833
+ xOffset: xOffset,
13834
+ yOffset: yOffset
13835
+ } = multilineLayout.bbox;
13836
+ doStroke && (strokeCb ? strokeCb(context, text.attribute, textAttribute) : sVisible && (context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute), multilineLayout.lines.forEach(line => {
13837
+ context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
13838
+ }))), doFill && (fillCb ? fillCb(context, text.attribute, textAttribute) : fVisible && (context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute), multilineLayout.lines.forEach(line => {
13839
+ 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, {
13840
+ width: line.width
13677
13841
  });
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);
13842
+ })));
13684
13843
  } else {
13844
+ let {
13845
+ textAlign = textAttribute.textAlign,
13846
+ textBaseline = textAttribute.textBaseline
13847
+ } = text.attribute;
13848
+ if (!verticalMode) {
13849
+ const t = textAlign;
13850
+ textAlign = null !== (_b = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = text.getAlignMapBaseline()[t]) && void 0 !== _c ? _c : "top";
13851
+ }
13685
13852
  text.tryUpdateAABBBounds();
13686
- const cache = text.cache;
13687
- if (cache) {
13688
- context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
13689
- const {
13853
+ const cache = text.cache,
13854
+ {
13690
13855
  verticalList: verticalList
13691
13856
  } = 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 => {
13857
+ context.textAlign = "left", context.textBaseline = "top";
13858
+ const totalHeight = lineHeight * verticalList.length;
13859
+ let totalW = 0;
13860
+ verticalList.forEach(verticalData => {
13861
+ const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
13862
+ totalW = max(_w, totalW);
13863
+ });
13864
+ let offsetY = 0,
13865
+ offsetX = 0;
13866
+ "bottom" === textBaseline ? offsetX = -totalHeight : "middle" === textBaseline && (offsetX = -totalHeight / 2), "center" === textAlign ? offsetY -= totalW / 2 : "right" === textAlign && (offsetY -= totalW), verticalList.forEach((verticalData, i) => {
13867
+ const currentW = verticalData.reduce((a, b) => a + (b.width || 0), 0),
13868
+ dw = totalW - currentW;
13869
+ let currentOffsetY = offsetY;
13870
+ "center" === textAlign ? currentOffsetY += dw / 2 : "right" === textAlign && (currentOffsetY += dw), verticalData.forEach(item => {
13696
13871
  const {
13697
13872
  text: text,
13698
13873
  width: width,
13699
13874
  direction: direction
13700
13875
  } = item;
13701
- drawText(text, offsetX, offsetY, direction), offsetY += width;
13876
+ drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction), currentOffsetY += width;
13702
13877
  });
13703
- }
13878
+ });
13704
13879
  }
13705
13880
  transform3dMatrixToContextMatrix && this.restoreTransformUseContext2d(text, textAttribute, z, context), this.afterRenderStep(text, context, x, y, doFill, doStroke, fVisible, sVisible, textAttribute, drawContext, fillCb, strokeCb);
13706
13881
  }
@@ -13712,12 +13887,10 @@ let DefaultCanvasTextRender = class extends BaseRender {
13712
13887
  computed3dMatrix = !keepDirIn3d;
13713
13888
  this._draw(text, textAttribute, computed3dMatrix, drawContext, params);
13714
13889
  }
13715
- drawUnderLine(underline, lineThrough, text, x, y, z, textAttribute, context, multiOption) {
13890
+ drawUnderLine(underline, lineThrough, text, anchorX, anchorY, offsetUnderLineY, offsetThroughLineY, z, textAttribute, context, multiOption) {
13716
13891
  if (lineThrough + underline <= 0) return;
13717
13892
  const {
13718
13893
  textAlign = textAttribute.textAlign,
13719
- textBaseline = textAttribute.textBaseline,
13720
- fontSize = textAttribute.fontSize,
13721
13894
  fill = textAttribute.fill,
13722
13895
  opacity = textAttribute.opacity,
13723
13896
  underlineOffset = textAttribute.underlineOffset,
@@ -13727,23 +13900,21 @@ let DefaultCanvasTextRender = class extends BaseRender {
13727
13900
  isMulti = !isNil$1(multiOption),
13728
13901
  w = isMulti ? multiOption.width : text.clipedWidth,
13729
13902
  offsetX = isMulti ? 0 : textDrawOffsetX(textAlign, w),
13730
- offsetY = textLayoutOffsetY(isMulti ? "alphabetic" : textBaseline, fontSize, fontSize),
13731
13903
  attribute = {
13732
13904
  lineWidth: 0,
13733
13905
  stroke: fill,
13734
13906
  opacity: opacity,
13735
13907
  strokeOpacity: fillOpacity
13736
13908
  };
13737
- let deltaY = isMulti ? -3 : 0;
13738
13909
  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();
13910
+ attribute.lineWidth = underline, context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute), underlineDash && context.setLineDash(underlineDash), context.beginPath();
13911
+ const dy = anchorY + offsetUnderLineY + underlineOffset;
13912
+ context.moveTo(anchorX + offsetX, dy, z), context.lineTo(anchorX + offsetX + w, dy, z), context.stroke();
13742
13913
  }
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();
13914
+ if (lineThrough) {
13915
+ attribute.lineWidth = lineThrough, context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute), context.beginPath();
13916
+ const dy = anchorY + offsetThroughLineY;
13917
+ context.moveTo(anchorX + offsetX, dy, z), context.lineTo(anchorX + offsetX + w, dy, z), context.stroke();
13747
13918
  }
13748
13919
  }
13749
13920
  };
@@ -13839,7 +14010,8 @@ let DefaultCanvasPolygonRender = class extends BaseRender {
13839
14010
  cornerRadius = polygonAttribute.cornerRadius,
13840
14011
  x: originX = polygonAttribute.x,
13841
14012
  y: originY = polygonAttribute.y,
13842
- closePath = polygonAttribute.closePath
14013
+ closePath = polygonAttribute.closePath,
14014
+ fillStrokeOrder = polygonAttribute.fillStrokeOrder
13843
14015
  } = polygon.attribute,
13844
14016
  data = this.valid(polygon, polygonAttribute, fillCb, strokeCb);
13845
14017
  if (!data) return;
@@ -13849,7 +14021,14 @@ let DefaultCanvasPolygonRender = class extends BaseRender {
13849
14021
  doFill: doFill,
13850
14022
  doStroke: doStroke
13851
14023
  } = 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);
14024
+ 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);
14025
+ const _runFill = () => {
14026
+ doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fVisible && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill()));
14027
+ },
14028
+ _runStroke = () => {
14029
+ doStroke && (strokeCb ? strokeCb(context, polygon.attribute, polygonAttribute) : sVisible && (context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.stroke()));
14030
+ };
14031
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
13853
14032
  }
13854
14033
  draw(polygon, renderService, drawContext, params) {
13855
14034
  const polygonAttribute = getTheme(polygon, null == params ? void 0 : params.theme).polygon;
@@ -13892,7 +14071,10 @@ let DefaultCanvasGroupRender = class {
13892
14071
  cornerRadius = groupAttribute.cornerRadius,
13893
14072
  path = groupAttribute.path,
13894
14073
  lineWidth = groupAttribute.lineWidth,
13895
- visible = groupAttribute.visible
14074
+ visible = groupAttribute.visible,
14075
+ fillStrokeOrder = groupAttribute.fillStrokeOrder,
14076
+ x: originX = groupAttribute.x,
14077
+ y: originY = groupAttribute.y
13896
14078
  } = group.attribute,
13897
14079
  fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
13898
14080
  sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
@@ -13918,7 +14100,14 @@ let DefaultCanvasGroupRender = class {
13918
14100
  };
13919
14101
  this._groupRenderContribitions.forEach(c => {
13920
14102
  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 => {
14103
+ }), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);
14104
+ const _runFill = () => {
14105
+ doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, originX - x, originY - y, groupAttribute), context.fill()));
14106
+ },
14107
+ _runStroke = () => {
14108
+ doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, originX - x, originY - y, groupAttribute), context.stroke()));
14109
+ };
14110
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this._groupRenderContribitions.forEach(c => {
13922
14111
  c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
13923
14112
  });
13924
14113
  }
@@ -13984,6 +14173,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
13984
14173
  x: originX = imageAttribute.x,
13985
14174
  y: originY = imageAttribute.y,
13986
14175
  cornerRadius = imageAttribute.cornerRadius,
14176
+ fillStrokeOrder = imageAttribute.fillStrokeOrder,
13987
14177
  image: url
13988
14178
  } = image.attribute,
13989
14179
  data = this.valid(image, imageAttribute, fillCb);
@@ -13994,20 +14184,26 @@ let DefaultCanvasImageRender = class extends BaseRender {
13994
14184
  doFill: doFill,
13995
14185
  doStroke: doStroke
13996
14186
  } = 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);
14187
+ context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
14188
+ const _runFill = () => {
14189
+ if (doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
14190
+ if (!url || !image.resources) return;
14191
+ const res = image.resources.get(url);
14192
+ if ("success" !== res.state) return;
14193
+ let needRestore = !1;
14194
+ 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);
14195
+ let repeat = 0;
14196
+ if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
14197
+ const pattern = context.createPattern(res.data, repeatStr[repeat]);
14198
+ context.fillStyle = pattern, context.translate(x, y, !0), context.fillRect(0, 0, width, height), context.translate(-x, -y, !0);
14199
+ } else context.drawImage(res.data, x, y, width, height);
14200
+ needRestore && context.restore();
14201
+ }
14202
+ },
14203
+ _runStroke = () => {
14204
+ doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke()));
14205
+ };
14206
+ fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
14011
14207
  }
14012
14208
  draw(image, renderService, drawContext) {
14013
14209
  const {
@@ -14401,58 +14597,60 @@ class CanvasTextLayout {
14401
14597
  constructor(fontFamily, options, textMeasure) {
14402
14598
  this.fontFamily = fontFamily, this.textOptions = options, this.textMeasure = textMeasure;
14403
14599
  }
14404
- LayoutBBox(bbox, textAlign, textBaseline) {
14600
+ LayoutBBox(bbox, textAlign, textBaseline, linesLayout) {
14405
14601
  if ("left" === textAlign || "start" === textAlign) bbox.xOffset = 0;else if ("center" === textAlign) bbox.xOffset = bbox.width / -2;else {
14406
14602
  if ("right" !== textAlign && "end" !== textAlign) throw new Error("非法的textAlign");
14407
14603
  bbox.xOffset = -bbox.width;
14408
14604
  }
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);
14605
+ if ("top" === textBaseline) bbox.yOffset = 0;else if ("middle" === textBaseline) bbox.yOffset = bbox.height / -2;else if ("alphabetic" === textBaseline) {
14606
+ let percent = .79;
14607
+ if (1 === linesLayout.length) {
14608
+ const lineInfo = linesLayout[0];
14609
+ percent = lineInfo.ascent / (lineInfo.ascent + lineInfo.descent);
14610
+ }
14611
+ bbox.yOffset = bbox.height * -percent;
14612
+ } else bbox.yOffset = -bbox.height;
14613
+ return bbox;
14432
14614
  }
14433
14615
  GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
14434
14616
  let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
14435
14617
  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";
14618
+ let params = arguments.length > 6 ? arguments[6] : undefined;
14619
+ const {
14620
+ lineWidth: lineWidth,
14621
+ suffixPosition = "end",
14622
+ measureMode = MeasureModeEnum.actualBounding
14623
+ } = null != params ? params : {};
14438
14624
  lines = lines.map(l => l.toString());
14439
14625
  const linesLayout = [],
14440
14626
  bboxWH = [0, 0];
14441
14627
  if ("number" == typeof lineWidth && lineWidth !== 1 / 0) {
14442
14628
  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
- });
14629
+ for (let i = 0, len = lines.length; i < len; i++) {
14630
+ const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
14631
+ width = Math.min(metrics.width, lineWidth), linesLayout.push({
14632
+ str: metrics.width <= lineWidth ? lines[i].toString() : this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
14633
+ width: width,
14634
+ ascent: metrics.ascent,
14635
+ descent: metrics.descent
14636
+ });
14637
+ }
14447
14638
  bboxWH[0] = lineWidth;
14448
14639
  } 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;
14640
+ let width,
14641
+ text,
14642
+ _lineWidth = 0;
14643
+ for (let i = 0, len = lines.length; i < len; i++) {
14644
+ text = lines[i];
14645
+ const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
14646
+ width = metrics.width, _lineWidth = Math.max(_lineWidth, width), linesLayout.push({
14647
+ str: text,
14648
+ width: width,
14649
+ ascent: metrics.ascent,
14650
+ descent: metrics.descent
14651
+ });
14652
+ }
14653
+ bboxWH[0] = _lineWidth;
14456
14654
  }
14457
14655
  bboxWH[1] = linesLayout.length * lineHeight, bboxWH[0] = linesLayout.reduce((a, b) => Math.max(a, b.width), 0);
14458
14656
  const bbox = {
@@ -14461,7 +14659,7 @@ class CanvasTextLayout {
14461
14659
  width: bboxWH[0],
14462
14660
  height: bboxWH[1]
14463
14661
  };
14464
- return this.LayoutBBox(bbox, textAlign, textBaseline), this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
14662
+ return this.LayoutBBox(bbox, textAlign, textBaseline, linesLayout), this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
14465
14663
  }
14466
14664
  layoutWithBBox(bbox, lines, textAlign, textBaseline, lineHeight) {
14467
14665
  const origin = [0, 0],
@@ -14480,11 +14678,13 @@ class CanvasTextLayout {
14480
14678
  };
14481
14679
  }
14482
14680
  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;
14681
+ "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];
14682
+ const actualHeightWithBuf = line.ascent + line.descent + 0;
14683
+ return actualHeightWithBuf < lineHeight - 0 && ("bottom" === textBaseline ? line.topOffset += (lineHeight - actualHeightWithBuf) / 2 : "top" === textBaseline && (line.topOffset -= (lineHeight - actualHeightWithBuf) / 2)), origin[1] += lineHeight, line;
14484
14684
  }
14485
14685
  }
14486
14686
 
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];
14687
+ 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
14688
  class Text extends Graphic {
14489
14689
  get font() {
14490
14690
  const textTheme = this.getGraphicTheme();
@@ -14493,26 +14693,22 @@ class Text extends Graphic {
14493
14693
  get clipedText() {
14494
14694
  var _a;
14495
14695
  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();
14696
+ textTheme = this.getGraphicTheme(),
14697
+ maxWidth = this.getMaxWidth(textTheme);
14698
+ return Number.isFinite(maxWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
14502
14699
  }
14503
14700
  get clipedWidth() {
14504
- if (this.isSimplify()) return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
14701
+ return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
14505
14702
  }
14506
14703
  get cliped() {
14507
14704
  var _a, _b;
14508
14705
  const textTheme = this.getGraphicTheme(),
14509
14706
  attribute = this.attribute,
14510
- {
14511
- maxLineWidth = textTheme.maxLineWidth,
14512
- text: text,
14513
- whiteSpace = textTheme.whiteSpace
14514
- } = attribute;
14515
- if (!Number.isFinite(maxLineWidth)) return !1;
14707
+ maxWidth = this.getMaxWidth(textTheme);
14708
+ if (!Number.isFinite(maxWidth)) return !1;
14709
+ const {
14710
+ text: text
14711
+ } = this.attribute;
14516
14712
  if (this.tryUpdateAABBBounds(), null === (_b = null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData) || void 0 === _b ? void 0 : _b.lines) {
14517
14713
  let mergedText = "";
14518
14714
  this.cache.layoutData.lines.forEach(item => {
@@ -14523,10 +14719,7 @@ class Text extends Graphic {
14523
14719
  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
14720
  }
14525
14721
  get multilineLayout() {
14526
- if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
14527
- }
14528
- isSimplify() {
14529
- return !this.isMultiLine && "vertical" !== this.attribute.direction;
14722
+ return this.tryUpdateAABBBounds(), this.cache.layoutData;
14530
14723
  }
14531
14724
  get isMultiLine() {
14532
14725
  return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
@@ -14599,8 +14792,72 @@ class Text extends Graphic {
14599
14792
  }
14600
14793
  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
14794
  }
14795
+ updateSingallineAABBBounds(text) {
14796
+ this.updateMultilineAABBBounds([text]);
14797
+ const layoutData = this.cache.layoutData;
14798
+ if (layoutData) {
14799
+ const line = layoutData.lines[0];
14800
+ this.cache.clipedText = line.str, this.cache.clipedWidth = line.width;
14801
+ }
14802
+ return this._AABBBounds;
14803
+ }
14804
+ updateMultilineAABBBounds(text) {
14805
+ const textTheme = this.getGraphicTheme(),
14806
+ {
14807
+ direction = textTheme.direction,
14808
+ underlineOffset = textTheme.underlineOffset
14809
+ } = this.attribute,
14810
+ b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
14811
+ return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset), b;
14812
+ }
14813
+ guessLineHeightBuf(fontSize) {
14814
+ return fontSize ? .1 * fontSize : 0;
14815
+ }
14816
+ updateHorizontalMultilineAABBBounds(text) {
14817
+ var _a;
14818
+ const textTheme = this.getGraphicTheme(),
14819
+ attribute = this.attribute,
14820
+ {
14821
+ fontFamily = textTheme.fontFamily,
14822
+ textAlign = textTheme.textAlign,
14823
+ textBaseline = textTheme.textBaseline,
14824
+ fontSize = textTheme.fontSize,
14825
+ fontWeight = textTheme.fontWeight,
14826
+ ellipsis = textTheme.ellipsis,
14827
+ maxLineWidth: maxLineWidth,
14828
+ stroke = textTheme.stroke,
14829
+ wrap = textTheme.wrap,
14830
+ measureMode = textTheme.measureMode,
14831
+ lineWidth = textTheme.lineWidth,
14832
+ whiteSpace = textTheme.whiteSpace,
14833
+ suffixPosition = textTheme.suffixPosition,
14834
+ ignoreBuf = textTheme.ignoreBuf
14835
+ } = attribute,
14836
+ buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize),
14837
+ lineHeight = this.getLineHeight(attribute, textTheme) + buf;
14838
+ if ("normal" === whiteSpace || wrap) return this.updateWrapAABBBounds(text);
14839
+ if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
14840
+ const bbox = this.cache.layoutData.bbox;
14841
+ return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14842
+ }
14843
+ const textMeasure = application.graphicUtil.textMeasure,
14844
+ layoutData = new CanvasTextLayout(fontFamily, {
14845
+ fontSize: fontSize,
14846
+ fontWeight: fontWeight,
14847
+ fontFamily: fontFamily,
14848
+ lineHeight: lineHeight
14849
+ }, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, {
14850
+ lineWidth: maxLineWidth,
14851
+ suffixPosition: suffixPosition,
14852
+ measureMode: measureMode
14853
+ }),
14854
+ {
14855
+ bbox: bbox
14856
+ } = layoutData;
14857
+ 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;
14858
+ }
14602
14859
  updateWrapAABBBounds(text) {
14603
- var _a, _b, _c, _d;
14860
+ var _a, _b, _c;
14604
14861
  const textTheme = this.getGraphicTheme(),
14605
14862
  {
14606
14863
  fontFamily = textTheme.fontFamily,
@@ -14614,22 +14871,25 @@ class Text extends Graphic {
14614
14871
  wordBreak = textTheme.wordBreak,
14615
14872
  fontWeight = textTheme.fontWeight,
14616
14873
  ignoreBuf = textTheme.ignoreBuf,
14874
+ measureMode = textTheme.measureMode,
14617
14875
  suffixPosition = textTheme.suffixPosition,
14618
14876
  heightLimit = 0,
14619
14877
  lineClamp: lineClamp
14620
14878
  } = 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)) {
14879
+ buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize),
14880
+ lineHeight = this.getLineHeight(this.attribute, textTheme) + buf;
14881
+ if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
14624
14882
  const bbox = this.cache.layoutData.bbox;
14625
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;
14626
14884
  }
14627
14885
  const textMeasure = application.graphicUtil.textMeasure,
14628
- layoutObj = new CanvasTextLayout(fontFamily, {
14886
+ textOptions = {
14629
14887
  fontSize: fontSize,
14630
14888
  fontWeight: fontWeight,
14631
- fontFamily: fontFamily
14632
- }, textMeasure),
14889
+ fontFamily: fontFamily,
14890
+ lineHeight: lineHeight
14891
+ },
14892
+ layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure),
14633
14893
  lines = isArray$1(text) ? text.map(l => l.toString()) : [text.toString()],
14634
14894
  linesLayout = [],
14635
14895
  bboxWH = [0, 0];
@@ -14639,29 +14899,35 @@ class Text extends Graphic {
14639
14899
  const str = lines[i];
14640
14900
  let needCut = !0;
14641
14901
  if (i === lineCountLimit - 1) {
14642
- const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition, i !== lines.length - 1);
14902
+ const clip = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition, i !== lines.length - 1),
14903
+ matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
14643
14904
  linesLayout.push({
14644
14905
  str: clip.str,
14645
- width: clip.width
14906
+ width: clip.width,
14907
+ ascent: matrics.ascent,
14908
+ descent: matrics.descent
14646
14909
  });
14647
14910
  break;
14648
14911
  }
14649
- const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
14912
+ const clip = textMeasure.clipText(str, textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
14650
14913
  if ("" !== str && "" === clip.str || clip.wordBreaked) {
14651
14914
  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;
14915
+ const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
14916
+ clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
14654
14917
  } else clip.str = "", clip.width = 0;
14655
14918
  needCut = !1;
14656
14919
  }
14920
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
14657
14921
  linesLayout.push({
14658
14922
  str: clip.str,
14659
- width: clip.width
14923
+ width: clip.width,
14924
+ ascent: matrics.ascent,
14925
+ descent: matrics.descent
14660
14926
  });
14661
14927
  let cutLength = clip.str.length;
14662
14928
  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);
14929
+ const newStr = str.substring(cutLength);
14930
+ lines.splice(i + 1, 0, newStr);
14665
14931
  }
14666
14932
  }
14667
14933
  let maxWidth = 0;
@@ -14674,235 +14940,44 @@ class Text extends Graphic {
14674
14940
  lineWidth = 0;
14675
14941
  for (let i = 0, len = lines.length; i < len; i++) {
14676
14942
  if (i === lineCountLimit - 1) {
14677
- const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
14943
+ const clip = textMeasure.clipTextWithSuffix(lines[i], textOptions, maxLineWidth, ellipsis, !1, suffixPosition),
14944
+ matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
14678
14945
  linesLayout.push({
14679
14946
  str: clip.str,
14680
- width: clip.width
14947
+ width: clip.width,
14948
+ ascent: matrics.ascent,
14949
+ descent: matrics.descent
14681
14950
  }), lineWidth = Math.max(lineWidth, clip.width);
14682
14951
  break;
14683
14952
  }
14684
- text = lines[i], width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, "break-word" === wordBreak), lineWidth = Math.max(lineWidth, width), linesLayout.push({
14953
+ text = lines[i], width = textMeasure.measureTextWidth(text, textOptions), lineWidth = Math.max(lineWidth, width);
14954
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);
14955
+ linesLayout.push({
14685
14956
  str: text,
14686
- width: width
14957
+ width: width,
14958
+ ascent: matrics.ascent,
14959
+ descent: matrics.descent
14687
14960
  });
14688
14961
  }
14689
14962
  bboxWH[0] = lineWidth;
14690
14963
  }
14691
- bboxWH[1] = linesLayout.length * (lineHeight + buf);
14964
+ bboxWH[1] = linesLayout.length * lineHeight;
14692
14965
  const bbox = {
14693
14966
  xOffset: 0,
14694
14967
  yOffset: 0,
14695
14968
  width: bboxWH[0],
14696
14969
  height: bboxWH[1]
14697
14970
  };
14698
- layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
14971
+ layoutObj.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
14699
14972
  const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
14700
14973
  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
14974
  }
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
14975
  updateVerticalMultilineAABBBounds(text) {
14897
- var _a, _b, _c;
14976
+ var _a, _b;
14898
14977
  const textTheme = this.getGraphicTheme(),
14899
14978
  textMeasure = application.graphicUtil.textMeasure;
14900
14979
  let width;
14901
14980
  const attribute = this.attribute,
14902
- {
14903
- ignoreBuf = textTheme.ignoreBuf
14904
- } = attribute,
14905
- buf = ignoreBuf ? 0 : 2,
14906
14981
  {
14907
14982
  maxLineWidth = textTheme.maxLineWidth,
14908
14983
  ellipsis = textTheme.ellipsis,
@@ -14914,14 +14989,14 @@ class Text extends Graphic {
14914
14989
  verticalMode = textTheme.verticalMode,
14915
14990
  suffixPosition = textTheme.suffixPosition
14916
14991
  } = attribute,
14917
- lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
14992
+ lineHeight = this.getLineHeight(attribute, textTheme);
14918
14993
  let {
14919
14994
  textAlign = textTheme.textAlign,
14920
14995
  textBaseline = textTheme.textBaseline
14921
14996
  } = attribute;
14922
14997
  if (!verticalMode) {
14923
14998
  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";
14999
+ textAlign = null !== (_a = Text.baselineMapAlign[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = Text.alignMapBaseline[t]) && void 0 !== _b ? _b : "top";
14925
15000
  }
14926
15001
  if (width = 0, !this.shouldUpdateShape() && this.cache) {
14927
15002
  this.cache.verticalList.forEach(item => {
@@ -14969,6 +15044,15 @@ class Text extends Graphic {
14969
15044
  dy = textLayoutOffsetY(textBaseline, height, fontSize);
14970
15045
  return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
14971
15046
  }
15047
+ getMaxWidth(theme) {
15048
+ var _a, _b;
15049
+ const attribute = this.attribute;
15050
+ return null !== (_b = null !== (_a = attribute.maxLineWidth) && void 0 !== _a ? _a : attribute.maxWidth) && void 0 !== _b ? _b : theme.maxWidth;
15051
+ }
15052
+ getLineHeight(attribute, textTheme) {
15053
+ var _a;
15054
+ return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
15055
+ }
14972
15056
  needUpdateTags(keys) {
14973
15057
  let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
14974
15058
  return super.needUpdateTags(keys, k);
@@ -14983,6 +15067,12 @@ class Text extends Graphic {
14983
15067
  getNoWorkAnimateAttr() {
14984
15068
  return Text.NOWORK_ANIMATE_ATTR;
14985
15069
  }
15070
+ getBaselineMapAlign() {
15071
+ return Text.baselineMapAlign;
15072
+ }
15073
+ getAlignMapBaseline() {
15074
+ return Text.alignMapBaseline;
15075
+ }
14986
15076
  }
14987
15077
  Text.NOWORK_ANIMATE_ATTR = Object.assign({
14988
15078
  ellipsis: 1,
@@ -15061,7 +15151,9 @@ class WrapText extends Text {
15061
15151
  const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
15062
15152
  linesLayout.push({
15063
15153
  str: clip.str,
15064
- width: clip.width
15154
+ width: clip.width,
15155
+ ascent: 0,
15156
+ descent: 0
15065
15157
  });
15066
15158
  break;
15067
15159
  }
@@ -15075,7 +15167,9 @@ class WrapText extends Text {
15075
15167
  }
15076
15168
  if (linesLayout.push({
15077
15169
  str: clip.str,
15078
- width: clip.width
15170
+ width: clip.width,
15171
+ ascent: 0,
15172
+ descent: 0
15079
15173
  }), clip.str.length === str.length) ;else if (needCut) {
15080
15174
  const newStr = str.substring(clip.str.length);
15081
15175
  lines.splice(i + 1, 0, newStr);
@@ -15094,13 +15188,17 @@ class WrapText extends Text {
15094
15188
  const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
15095
15189
  linesLayout.push({
15096
15190
  str: clip.str,
15097
- width: clip.width
15191
+ width: clip.width,
15192
+ ascent: 0,
15193
+ descent: 0
15098
15194
  }), lineWidth = Math.max(lineWidth, clip.width);
15099
15195
  break;
15100
15196
  }
15101
15197
  text = lines[i], width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, "break-word" === wordBreak), lineWidth = Math.max(lineWidth, width), linesLayout.push({
15102
15198
  str: text,
15103
- width: width
15199
+ width: width,
15200
+ ascent: 0,
15201
+ descent: 0
15104
15202
  });
15105
15203
  }
15106
15204
  bboxWH[0] = lineWidth;
@@ -15144,6 +15242,9 @@ class BaseSymbol {
15144
15242
  bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
15145
15243
  } else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
15146
15244
  }
15245
+ parseSize(size) {
15246
+ return isNumber$1(size) ? size : Math.min(size[0], size[1]);
15247
+ }
15147
15248
  }
15148
15249
 
15149
15250
  function circle(ctx, r, x, y, z) {
@@ -15154,13 +15255,13 @@ class CircleSymbol extends BaseSymbol {
15154
15255
  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
15256
  }
15156
15257
  draw(ctx, size, x, y, z) {
15157
- return circle(ctx, size / 2, x, y, z);
15258
+ return circle(ctx, this.parseSize(size) / 2, x, y, z);
15158
15259
  }
15159
15260
  drawOffset(ctx, size, x, y, offset, z) {
15160
- return circle(ctx, size / 2 + offset, x, y, z);
15261
+ return circle(ctx, this.parseSize(size) / 2 + offset, x, y, z);
15161
15262
  }
15162
15263
  drawToSvgPath(size, x, y, z) {
15163
- const r = size / 2;
15264
+ const r = this.parseSize(size) / 2;
15164
15265
  return `M ${x - r}, ${y} a ${r},${r} 0 1,0 ${2 * r},0 a ${r},${r} 0 1,0 -${2 * r},0`;
15165
15266
  }
15166
15267
  }
@@ -15177,10 +15278,10 @@ class CrossSymbol extends BaseSymbol {
15177
15278
  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
15279
  }
15179
15280
  draw(ctx, size, x, y, z) {
15180
- return cross(ctx, size / 6, x, y, z);
15281
+ return cross(ctx, this.parseSize(size) / 6, x, y, z);
15181
15282
  }
15182
15283
  drawOffset(ctx, size, x, y, offset, z) {
15183
- return crossOffset(ctx, size / 6, x, y, offset, z);
15284
+ return crossOffset(ctx, this.parseSize(size) / 6, x, y, offset, z);
15184
15285
  }
15185
15286
  }
15186
15287
  var cross$1 = new CrossSymbol();
@@ -15193,13 +15294,13 @@ class DiamondSymbol extends BaseSymbol {
15193
15294
  super(...arguments), this.type = "diamond", this.pathStr = "M-0.5,0L0,-0.5L0.5,0L0,0.5Z";
15194
15295
  }
15195
15296
  draw(ctx, size, x, y, z) {
15196
- return diamond(ctx, size / 2, x, y, z);
15297
+ return diamond(ctx, this.parseSize(size) / 2, x, y, z);
15197
15298
  }
15198
15299
  drawFitDir(ctx, size, x, y, z) {
15199
- return diamond(ctx, size / 2, x, y, z);
15300
+ return diamond(ctx, this.parseSize(size) / 2, x, y, z);
15200
15301
  }
15201
15302
  drawOffset(ctx, size, x, y, offset, z) {
15202
- return diamond(ctx, size / 2 + offset, x, y, z);
15303
+ return diamond(ctx, this.parseSize(size) / 2 + offset, x, y, z);
15203
15304
  }
15204
15305
  }
15205
15306
  var diamond$1 = new DiamondSymbol();
@@ -15213,10 +15314,10 @@ class SquareSymbol extends BaseSymbol {
15213
15314
  super(...arguments), this.type = "square", this.pathStr = "M-0.5,-0.5h1v1h-1Z";
15214
15315
  }
15215
15316
  draw(ctx, size, x, y) {
15216
- return square(ctx, size / 2, x, y);
15317
+ return square(ctx, this.parseSize(size) / 2, x, y);
15217
15318
  }
15218
15319
  drawOffset(ctx, size, x, y, offset) {
15219
- return square(ctx, size / 2 + offset, x, y);
15320
+ return square(ctx, this.parseSize(size) / 2 + offset, x, y);
15220
15321
  }
15221
15322
  }
15222
15323
  var square$1 = new SquareSymbol();
@@ -15230,10 +15331,10 @@ class TriangleUpSymbol extends BaseSymbol {
15230
15331
  super(...arguments), this.type = "triangleUp", this.pathStr = "M0.5,0.5 L-0.5,0.5 L0,-0.5 Z";
15231
15332
  }
15232
15333
  draw(ctx, size, x, y) {
15233
- return trianglUpOffset(ctx, size / 2, x, y);
15334
+ return trianglUpOffset(ctx, this.parseSize(size) / 2, x, y);
15234
15335
  }
15235
15336
  drawOffset(ctx, size, x, y, offset) {
15236
- return trianglUpOffset(ctx, size / 2, x, y, offset);
15337
+ return trianglUpOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15237
15338
  }
15238
15339
  }
15239
15340
  var triangleUp = new TriangleUpSymbol();
@@ -15265,10 +15366,10 @@ class StarSymbol extends BaseSymbol {
15265
15366
  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
15367
  }
15267
15368
  draw(ctx, size, transX, transY) {
15268
- return star(ctx, size / 2, transX, transY);
15369
+ return star(ctx, this.parseSize(size) / 2, transX, transY);
15269
15370
  }
15270
15371
  drawOffset(ctx, size, transX, transY, offset) {
15271
- return star(ctx, size / 2 + offset, transX, transY);
15372
+ return star(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15272
15373
  }
15273
15374
  }
15274
15375
  var star$1 = new StarSymbol();
@@ -15286,10 +15387,10 @@ class ArrowSymbol extends BaseSymbol {
15286
15387
  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
15388
  }
15288
15389
  draw(ctx, size, transX, transY) {
15289
- return arrow(ctx, size / 2, transX, transY);
15390
+ return arrow(ctx, this.parseSize(size) / 2, transX, transY);
15290
15391
  }
15291
15392
  drawOffset(ctx, size, transX, transY, offset) {
15292
- return arrow(ctx, size / 2 + offset, transX, transY);
15393
+ return arrow(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15293
15394
  }
15294
15395
  }
15295
15396
  var arrow$1 = new ArrowSymbol();
@@ -15303,10 +15404,10 @@ class WedgeSymbol extends BaseSymbol {
15303
15404
  super(...arguments), this.type = "wedge", this.pathStr = "M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z";
15304
15405
  }
15305
15406
  draw(ctx, size, transX, transY) {
15306
- return wedge(ctx, size / 2, transX, transY);
15407
+ return wedge(ctx, this.parseSize(size) / 2, transX, transY);
15307
15408
  }
15308
15409
  drawOffset(ctx, size, transX, transY, offset) {
15309
- return wedge(ctx, size / 2 + offset, transX, transY);
15410
+ return wedge(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15310
15411
  }
15311
15412
  }
15312
15413
  var wedge$1 = new WedgeSymbol();
@@ -15319,10 +15420,10 @@ class StrokeSymbol extends BaseSymbol {
15319
15420
  super(...arguments), this.type = "stroke", this.pathStr = "";
15320
15421
  }
15321
15422
  draw(ctx, size, transX, transY) {
15322
- return stroke(ctx, size / 2, transX, transY);
15423
+ return stroke(ctx, this.parseSize(size) / 2, transX, transY);
15323
15424
  }
15324
15425
  drawOffset(ctx, size, transX, transY, offset) {
15325
- return stroke(ctx, size / 2 + offset, transX, transY);
15426
+ return stroke(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15326
15427
  }
15327
15428
  }
15328
15429
  var stroke$1 = new StrokeSymbol();
@@ -15344,10 +15445,10 @@ class WyeSymbol extends BaseSymbol {
15344
15445
  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
15446
  }
15346
15447
  draw(ctx, size, transX, transY) {
15347
- return wye(ctx, size / 2, transX, transY);
15448
+ return wye(ctx, this.parseSize(size) / 2, transX, transY);
15348
15449
  }
15349
15450
  drawOffset(ctx, size, transX, transY, offset) {
15350
- return wye(ctx, size / 2 + offset, transX, transY);
15451
+ return wye(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15351
15452
  }
15352
15453
  }
15353
15454
  var wye$1 = new WyeSymbol();
@@ -15360,10 +15461,10 @@ class TriangleLeftSymbol extends BaseSymbol {
15360
15461
  super(...arguments), this.type = "triangleLeft", this.pathStr = "M-0.5,0 L0.5,0.5 L0.5,-0.5 Z";
15361
15462
  }
15362
15463
  draw(ctx, size, x, y) {
15363
- return trianglLeftOffset(ctx, size / 2, x, y, 0);
15464
+ return trianglLeftOffset(ctx, this.parseSize(size) / 2, x, y, 0);
15364
15465
  }
15365
15466
  drawOffset(ctx, size, x, y, offset) {
15366
- return trianglLeftOffset(ctx, size / 2, x, y, offset);
15467
+ return trianglLeftOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15367
15468
  }
15368
15469
  }
15369
15470
  var triangleLeft = new TriangleLeftSymbol();
@@ -15377,10 +15478,10 @@ class TriangleRightSymbol extends BaseSymbol {
15377
15478
  super(...arguments), this.type = "triangleRight", this.pathStr = "M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z";
15378
15479
  }
15379
15480
  draw(ctx, size, x, y) {
15380
- return trianglRightOffset(ctx, size / 2, x, y);
15481
+ return trianglRightOffset(ctx, this.parseSize(size) / 2, x, y);
15381
15482
  }
15382
15483
  drawOffset(ctx, size, x, y, offset) {
15383
- return trianglRightOffset(ctx, size / 2, x, y, offset);
15484
+ return trianglRightOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15384
15485
  }
15385
15486
  }
15386
15487
  var triangleRight = new TriangleRightSymbol();
@@ -15394,10 +15495,10 @@ class TriangleDownSymbol extends BaseSymbol {
15394
15495
  super(...arguments), this.type = "triangleDown", this.pathStr = "M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z";
15395
15496
  }
15396
15497
  draw(ctx, size, x, y) {
15397
- return trianglDownOffset(ctx, size / 2, x, y);
15498
+ return trianglDownOffset(ctx, this.parseSize(size) / 2, x, y);
15398
15499
  }
15399
15500
  drawOffset(ctx, size, x, y, offset) {
15400
- return trianglDownOffset(ctx, size / 2, x, y, offset);
15501
+ return trianglDownOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15401
15502
  }
15402
15503
  }
15403
15504
  var triangleDown = new TriangleDownSymbol();
@@ -15412,10 +15513,10 @@ class ThinTriangleSymbol extends BaseSymbol {
15412
15513
  super(...arguments), this.type = "thinTriangle", this.pathStr = "M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z";
15413
15514
  }
15414
15515
  draw(ctx, size, x, y) {
15415
- return thinTriangle(ctx, size / 2 / sqrt3, x, y);
15516
+ return thinTriangle(ctx, this.parseSize(size) / 2 / sqrt3, x, y);
15416
15517
  }
15417
15518
  drawOffset(ctx, size, x, y, offset) {
15418
- return thinTriangle(ctx, size / 2 / sqrt3 + offset, x, y);
15519
+ return thinTriangle(ctx, this.parseSize(size) / 2 / sqrt3 + offset, x, y);
15419
15520
  }
15420
15521
  }
15421
15522
  var thinTriangle$1 = new ThinTriangleSymbol();
@@ -15429,10 +15530,10 @@ class Arrow2LeftSymbol extends BaseSymbol {
15429
15530
  super(...arguments), this.type = "arrow2Left", this.pathStr = "M 0.25 -0.5 L -0.25 0 l 0.25 0.5";
15430
15531
  }
15431
15532
  draw(ctx, size, transX, transY) {
15432
- return arrow2Left(ctx, size / 4, transX, transY);
15533
+ return arrow2Left(ctx, this.parseSize(size) / 4, transX, transY);
15433
15534
  }
15434
15535
  drawOffset(ctx, size, transX, transY, offset) {
15435
- return arrow2Left(ctx, size / 4 + offset, transX, transY);
15536
+ return arrow2Left(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15436
15537
  }
15437
15538
  }
15438
15539
  var arrow2Left$1 = new Arrow2LeftSymbol();
@@ -15446,10 +15547,10 @@ class Arrow2RightSymbol extends BaseSymbol {
15446
15547
  super(...arguments), this.type = "arrow2Right", this.pathStr = "M -0.25 -0.5 l 0.25 0 l -0.25 0.5";
15447
15548
  }
15448
15549
  draw(ctx, size, transX, transY) {
15449
- return arrow2Right(ctx, size / 4, transX, transY);
15550
+ return arrow2Right(ctx, this.parseSize(size) / 4, transX, transY);
15450
15551
  }
15451
15552
  drawOffset(ctx, size, transX, transY, offset) {
15452
- return arrow2Right(ctx, size / 4 + offset, transX, transY);
15553
+ return arrow2Right(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15453
15554
  }
15454
15555
  }
15455
15556
  var arrow2Right$1 = new Arrow2RightSymbol();
@@ -15463,10 +15564,10 @@ class Arrow2UpSymbol extends BaseSymbol {
15463
15564
  super(...arguments), this.type = "arrow2Up", this.pathStr = "M -0.5 0.25 L 0 -0.25 l 0.5 0.25";
15464
15565
  }
15465
15566
  draw(ctx, size, transX, transY) {
15466
- return arrow2Up(ctx, size / 4, transX, transY);
15567
+ return arrow2Up(ctx, this.parseSize(size) / 4, transX, transY);
15467
15568
  }
15468
15569
  drawOffset(ctx, size, transX, transY, offset) {
15469
- return arrow2Up(ctx, size / 4 + offset, transX, transY);
15570
+ return arrow2Up(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15470
15571
  }
15471
15572
  }
15472
15573
  var arrow2Up$1 = new Arrow2UpSymbol();
@@ -15480,10 +15581,10 @@ class Arrow2DownSymbol extends BaseSymbol {
15480
15581
  super(...arguments), this.type = "arrow2Down", this.pathStr = "M -0.5 -0.25 L 0 0.25 l 0.5 -0.25";
15481
15582
  }
15482
15583
  draw(ctx, size, transX, transY) {
15483
- return arrow2Down(ctx, size / 4, transX, transY);
15584
+ return arrow2Down(ctx, this.parseSize(size) / 4, transX, transY);
15484
15585
  }
15485
15586
  drawOffset(ctx, size, transX, transY, offset) {
15486
- return arrow2Down(ctx, size / 4 + offset, transX, transY);
15587
+ return arrow2Down(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15487
15588
  }
15488
15589
  }
15489
15590
  var arrow2Down$1 = new Arrow2DownSymbol();
@@ -15496,13 +15597,13 @@ class LineVSymbol extends BaseSymbol {
15496
15597
  super(...arguments), this.type = "lineV", this.pathStr = "M0,-0.5L0,0.5";
15497
15598
  }
15498
15599
  draw(ctx, size, x, y, z) {
15499
- return lineV(ctx, size / 2, x, y);
15600
+ return lineV(ctx, this.parseSize(size) / 2, x, y);
15500
15601
  }
15501
15602
  drawOffset(ctx, size, x, y, offset, z) {
15502
- return lineV(ctx, size / 2 + offset, x, y);
15603
+ return lineV(ctx, this.parseSize(size) / 2 + offset, x, y);
15503
15604
  }
15504
15605
  drawToSvgPath(size, x, y, z) {
15505
- const r = size / 2;
15606
+ const r = this.parseSize(size) / 2;
15506
15607
  return `M ${x}, ${y - r} L ${x},${y + r}`;
15507
15608
  }
15508
15609
  }
@@ -15516,13 +15617,13 @@ class LineHSymbol extends BaseSymbol {
15516
15617
  super(...arguments), this.type = "lineH", this.pathStr = "M-0.5,0L0.5,0";
15517
15618
  }
15518
15619
  draw(ctx, size, x, y, z) {
15519
- return lineH(ctx, size / 2, x, y);
15620
+ return lineH(ctx, this.parseSize(size) / 2, x, y);
15520
15621
  }
15521
15622
  drawOffset(ctx, size, x, y, offset, z) {
15522
- return lineH(ctx, size / 2 + offset, x, y);
15623
+ return lineH(ctx, this.parseSize(size) / 2 + offset, x, y);
15523
15624
  }
15524
15625
  drawToSvgPath(size, x, y, z) {
15525
- const r = size / 2;
15626
+ const r = this.parseSize(size) / 2;
15526
15627
  return `M ${x - r}, ${y} L ${x + r},${y}`;
15527
15628
  }
15528
15629
  }
@@ -15536,13 +15637,13 @@ class CloseSymbol extends BaseSymbol {
15536
15637
  super(...arguments), this.type = "close", this.pathStr = "M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5";
15537
15638
  }
15538
15639
  draw(ctx, size, x, y, z) {
15539
- return close(ctx, size / 2, x, y);
15640
+ return close(ctx, this.parseSize(size) / 2, x, y);
15540
15641
  }
15541
15642
  drawOffset(ctx, size, x, y, offset, z) {
15542
- return close(ctx, size / 2 + offset, x, y);
15643
+ return close(ctx, this.parseSize(size) / 2 + offset, x, y);
15543
15644
  }
15544
15645
  drawToSvgPath(size, x, y, z) {
15545
- const r = size / 2;
15646
+ const r = this.parseSize(size) / 2;
15546
15647
  return `M ${x - r}, ${y - r} L ${x + r},${y + r} M ${x + r}, ${y - r} L ${x - r},${y + r}`;
15547
15648
  }
15548
15649
  }
@@ -15576,15 +15677,18 @@ class CustomSymbolClass {
15576
15677
  this.pathStr = "", this.type = type, isArray$1(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
15577
15678
  }
15578
15679
  drawOffset(ctx, size, x, y, offset, z, cb) {
15579
- return this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
15680
+ return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
15580
15681
  ctx.beginPath(), renderCommandList(item.path.commandList, ctx, x, y, size, size), cb && cb(item.path, item.attribute);
15581
15682
  }), !1) : (renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset), !1);
15582
15683
  }
15583
15684
  draw(ctx, size, x, y, z, cb) {
15584
- return this.drawOffset(ctx, size, x, y, 0, z, cb);
15685
+ return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
15686
+ }
15687
+ parseSize(size) {
15688
+ return isNumber$1(size) ? size : Math.min(size[0], size[1]);
15585
15689
  }
15586
15690
  bounds(size, bounds) {
15587
- if (this.isSvg) {
15691
+ if (size = this.parseSize(size), this.isSvg) {
15588
15692
  if (!this.svgCache) return;
15589
15693
  return bounds.clear(), void this.svgCache.forEach(_ref => {
15590
15694
  let {
@@ -16267,7 +16371,11 @@ class Paragraph {
16267
16371
  case "sub":
16268
16372
  baseline += this.descent / 2;
16269
16373
  }
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();
16374
+ "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);
16375
+ const {
16376
+ lineWidth = 1
16377
+ } = this.character;
16378
+ 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
16379
  }
16272
16380
  getWidthWithEllips(direction) {
16273
16381
  let text = this.text;
@@ -18272,6 +18380,42 @@ class AutoRenderPlugin {
18272
18380
  }
18273
18381
  }
18274
18382
 
18383
+ class AutoRefreshPlugin {
18384
+ constructor() {
18385
+ this.name = "AutoRefreshPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.handleChange = graphic => {
18386
+ graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage === this.pluginService.stage && null != graphic.stage && graphic.stage.renderNextFrame();
18387
+ };
18388
+ }
18389
+ activate(context) {
18390
+ this.pluginService = context, this.dpr = application.global.devicePixelRatio, this.refresh();
18391
+ }
18392
+ refresh() {
18393
+ this._refreshByMediaQuery() || this._refreshByRaf();
18394
+ }
18395
+ _refreshByRaf() {
18396
+ const raf = application.global.getRequestAnimationFrame();
18397
+ this.rafId = raf(() => {
18398
+ application.global.devicePixelRatio !== this.dpr && (this.dpr = application.global.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0)), this.refresh();
18399
+ });
18400
+ }
18401
+ _refreshByMediaQuery() {
18402
+ try {
18403
+ const mqString = `(resolution: ${window.devicePixelRatio}dppx)`,
18404
+ updatePixelRatio = () => {
18405
+ window.devicePixelRatio !== this.dpr && (this.dpr = window.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0));
18406
+ };
18407
+ matchMedia(mqString).addEventListener("change", updatePixelRatio);
18408
+ } catch (err) {
18409
+ return !1;
18410
+ }
18411
+ return !0;
18412
+ }
18413
+ deactivate(context) {
18414
+ const craf = application.global.getCancelAnimationFrame();
18415
+ craf && this.rafId && craf(this.rafId);
18416
+ }
18417
+ }
18418
+
18275
18419
  class IncrementalAutoRenderPlugin {
18276
18420
  constructor() {
18277
18421
  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 +18592,7 @@ class Stage extends Group {
18448
18592
  constructor() {
18449
18593
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18450
18594
  var _a;
18451
- super({}), this._onVisibleChange = visible => {
18595
+ super({}), this.tickedBeforeRender = !0, this._onVisibleChange = visible => {
18452
18596
  if (!(this._skipRender < 0)) if (visible) {
18453
18597
  if (this.dirtyBounds) {
18454
18598
  const b = this.window.getViewBox();
@@ -18459,7 +18603,10 @@ class Stage extends Group {
18459
18603
  }, this.beforeRender = stage => {
18460
18604
  this._beforeRender && this._beforeRender(stage);
18461
18605
  }, this.afterRender = stage => {
18462
- this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null;
18606
+ this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
18607
+ }, this.afterTickCb = () => {
18608
+ var _a;
18609
+ this.tickedBeforeRender = !0, "performance" === (null === (_a = this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) || "rendering" !== this.state && this.render();
18463
18610
  }, this.params = params, this.theme = new Theme(), this.hooks = {
18464
18611
  beforeRender: new SyncHook(["stage"]),
18465
18612
  afterRender: new SyncHook(["stage"])
@@ -18474,9 +18621,9 @@ class Stage extends Group {
18474
18621
  canvas: params.canvas
18475
18622
  }), 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
18623
  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({
18624
+ })), 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
18625
  background: this._background
18479
- });
18626
+ }), this.ticker.on("afterTick", this.afterTickCb);
18480
18627
  }
18481
18628
  pauseRender() {
18482
18629
  let sr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
@@ -18609,6 +18756,14 @@ class Stage extends Group {
18609
18756
  this.pluginService.unRegister(plugin);
18610
18757
  }));
18611
18758
  }
18759
+ enableAutoRefresh() {
18760
+ this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
18761
+ }
18762
+ disableAutoRefresh() {
18763
+ this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
18764
+ this.pluginService.unRegister(plugin);
18765
+ }));
18766
+ }
18612
18767
  enableIncrementalAutoRender() {
18613
18768
  this.increaseAutoRender || (this.increaseAutoRender = !0, this.pluginService.register(new IncrementalAutoRenderPlugin()));
18614
18769
  }
@@ -18697,7 +18852,7 @@ class Stage extends Group {
18697
18852
  if ("released" === this.releaseStatus) return;
18698
18853
  this.ticker.start(), this.timeline.resume();
18699
18854
  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++;
18855
+ 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
18856
  }
18702
18857
  combineLayersToWindow() {
18703
18858
  if ("harmony" === this.global.env) {
@@ -18803,7 +18958,7 @@ class Stage extends Group {
18803
18958
  layer.release();
18804
18959
  }), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
18805
18960
  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 = [];
18961
+ }), this.interactiveLayer.release()), this.window.release(), this.ticker.remTimeline(this.timeline), this.ticker.removeListener("afterTick", this.afterTickCb), this.renderService.renderTreeRoots = [];
18807
18962
  }
18808
18963
  setStage(stage) {}
18809
18964
  dirty(b, matrix) {
@@ -18881,8 +19036,6 @@ function createStage(params) {
18881
19036
  return new Stage(params);
18882
19037
  }
18883
19038
 
18884
- const strCommandMap = ["arc", "arcTo", "bezierCurveTo", "closePath", "ellipse", "lineTo", "moveTo", "quadraticCurveTo", "rect"];
18885
-
18886
19039
  var __decorate$1d = undefined && undefined.__decorate || function (decorators, target, key, desc) {
18887
19040
  var d,
18888
19041
  c = arguments.length,
@@ -19615,27 +19768,9 @@ function simplifyRadialDist(points, sqTolerance) {
19615
19768
  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
19769
  return points[points.length - 1].x === lastX && points[points.length - 1].y === lastY || newPoints.push(points[points.length - 1]), newPoints;
19617
19770
  }
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
19771
  function flatten_simplify(points, tolerance, highestQuality) {
19636
19772
  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);
19773
+ return points = highestQuality ? points : simplifyRadialDist(points, void 0 !== tolerance ? tolerance * tolerance : 1);
19639
19774
  }
19640
19775
 
19641
19776
  function findCursorIndexIgnoreLinebreak(textConfig, cursorIndex) {
@@ -23672,7 +23807,7 @@ class Gesture extends EventEmitter {
23672
23807
  let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23673
23808
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
23674
23809
  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();
23810
+ this.cachedEvents = [], this.startPoints = [], this.reset(), this.startTime = clock.now();
23676
23811
  const {
23677
23812
  cachedEvents: cachedEvents,
23678
23813
  startPoints: startPoints
@@ -23692,7 +23827,7 @@ class Gesture extends EventEmitter {
23692
23827
  if (1 !== startPoints.length) this.startDistance = calcDistance(startPoints[0], startPoints[1]), this.center = getCenter([startPoints[0], startPoints[1]]);else {
23693
23828
  const event = cachedEvents[0];
23694
23829
  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";
23830
+ 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
23831
  }, this.config.press.time);
23697
23832
  }
23698
23833
  }, this.onMove = ev => {
@@ -23755,10 +23890,10 @@ class Gesture extends EventEmitter {
23755
23890
  lastMovePoint = this.lastMovePoint || startPoints[0],
23756
23891
  distance = calcDistance(prevMovePoint, lastMovePoint),
23757
23892
  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));
23893
+ 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
23894
  }
23760
23895
  }
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);
23896
+ 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
23897
  }
23763
23898
  for (let i = 0, len = cachedEvents.length; i < len; i++) if (cachedEvents[i].pointerId === endEvent.pointerId) {
23764
23899
  cachedEvents.splice(i, 1), startPoints.splice(i, 1);
@@ -23800,7 +23935,7 @@ class Gesture extends EventEmitter {
23800
23935
  startTime: startTime,
23801
23936
  startPoints: startPoints
23802
23937
  } = this;
23803
- if (eventType) return eventType;
23938
+ if ("press" === eventType) return eventType;
23804
23939
  let type;
23805
23940
  return type = clock.now() - startTime > this.config.press.time && calcDistance(startPoints[0], point) < this.config.press.threshold ? "press" : "pan", this.eventType = type, type;
23806
23941
  }
@@ -23834,6 +23969,7 @@ class Gesture extends EventEmitter {
23834
23969
  emitThrottles: emitThrottles
23835
23970
  } = this;
23836
23971
  throttleTimer || (this.throttleTimer = application.global.getRequestAnimationFrame()(() => {
23972
+ application.global.getCancelAnimationFrame()(this.throttleTimer), this.throttleTimer = null;
23837
23973
  for (let i = 0, len = emitThrottles.length; i < len; i++) {
23838
23974
  const {
23839
23975
  type: type,
@@ -23841,7 +23977,7 @@ class Gesture extends EventEmitter {
23841
23977
  } = emitThrottles[i];
23842
23978
  this.emitEvent(type, ev);
23843
23979
  }
23844
- this.throttleTimer = 0, this.emitThrottles.length = 0;
23980
+ this.emitThrottles.length = 0;
23845
23981
  }));
23846
23982
  }
23847
23983
  triggerStartEvent(type, ev) {
@@ -24331,9 +24467,10 @@ let BrowserContext2d = class {
24331
24467
  lineJoin = defaultParams.lineJoin,
24332
24468
  lineDash = defaultParams.lineDash,
24333
24469
  lineCap = defaultParams.lineCap,
24334
- miterLimit = defaultParams.miterLimit
24470
+ miterLimit = defaultParams.miterLimit,
24471
+ keepStrokeScale = defaultParams.keepStrokeScale
24335
24472
  } = 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;
24473
+ _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
24474
  }
24338
24475
  }
24339
24476
  setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
@@ -25233,8 +25370,9 @@ class PickerBase {
25233
25370
  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
25371
  if (picked) return !0;
25235
25372
  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;
25373
+ pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
25374
+ keepStrokeScale = arcAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
25375
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
25238
25376
  }), pickContext.highPerformanceRestore(), picked;
25239
25377
  }
25240
25378
  }
@@ -25507,8 +25645,9 @@ class RectPickerBase {
25507
25645
  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
25646
  if (picked) return !0;
25509
25647
  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;
25648
+ pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
25649
+ keepStrokeScale = rectAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
25650
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
25512
25651
  });else {
25513
25652
  const {
25514
25653
  fill = rectAttribute.fill,
@@ -25822,9 +25961,10 @@ let LynxContext2d = class extends BrowserContext2d {
25822
25961
  lineJoin = defaultParams.lineJoin,
25823
25962
  lineDash = defaultParams.lineDash,
25824
25963
  lineCap = defaultParams.lineCap,
25825
- miterLimit = defaultParams.miterLimit
25964
+ miterLimit = defaultParams.miterLimit,
25965
+ keepStrokeScale = defaultParams.keepStrokeScale
25826
25966
  } = 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;
25967
+ _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
25968
  }
25829
25969
  }
25830
25970
  measureText(text) {
@@ -26452,9 +26592,10 @@ let TaroContext2d = class extends BrowserContext2d {
26452
26592
  lineJoin = defaultParams.lineJoin,
26453
26593
  lineDash = defaultParams.lineDash,
26454
26594
  lineCap = defaultParams.lineCap,
26455
- miterLimit = defaultParams.miterLimit
26595
+ miterLimit = defaultParams.miterLimit,
26596
+ keepStrokeScale = defaultParams.keepStrokeScale
26456
26597
  } = 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);
26598
+ _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
26599
  }
26459
26600
  }
26460
26601
  setTextStyleWithoutAlignBaseline(params, defaultParams) {
@@ -27494,9 +27635,10 @@ let HarmonyContext2d = class extends BrowserContext2d {
27494
27635
  lineJoin = defaultParams.lineJoin,
27495
27636
  lineDash = defaultParams.lineDash,
27496
27637
  lineCap = defaultParams.lineCap,
27497
- miterLimit = defaultParams.miterLimit
27638
+ miterLimit = defaultParams.miterLimit,
27639
+ keepStrokeScale = defaultParams.keepStrokeScale
27498
27640
  } = 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;
27641
+ _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
27642
  }
27501
27643
  }
27502
27644
  measureText(text) {
@@ -27903,8 +28045,9 @@ class BaseLinePicker extends BaseRender {
27903
28045
  return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, lineAttribute, themeAttribute) => {
27904
28046
  if (picked) return !0;
27905
28047
  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;
28048
+ pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
28049
+ keepStrokeScale = lineAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
28050
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
27908
28051
  }), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
27909
28052
  }
27910
28053
  }
@@ -28039,8 +28182,9 @@ let DefaultCanvasSymbolPicker = class extends Base3dPicker {
28039
28182
  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
28183
  if (picked) return !0;
28041
28184
  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;
28185
+ pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
28186
+ keepStrokeScale = symbolAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
28187
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
28044
28188
  }), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
28045
28189
  }
28046
28190
  };
@@ -28477,7 +28621,7 @@ const registerWrapText = _registerWrapText;
28477
28621
 
28478
28622
  const roughModule = _roughModule;
28479
28623
 
28480
- const version = "0.21.0-alpha.1";
28624
+ const version = "0.21.0-alpha.10";
28481
28625
  preLoadAllModule();
28482
28626
  if (isBrowserEnv()) {
28483
28627
  loadBrowserEnv(container);
@@ -28510,4 +28654,4 @@ registerReactAttributePlugin();
28510
28654
  registerDirectionalLight();
28511
28655
  registerOrthoCamera();
28512
28656
 
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 };
28657
+ 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 };