@visactor/vrender-core 0.21.0-alpha.4 → 0.21.0-alpha.6

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.
Files changed (210) hide show
  1. package/cjs/animate/Ticker/default-ticker.d.ts +4 -2
  2. package/cjs/animate/Ticker/default-ticker.js +8 -5
  3. package/cjs/animate/Ticker/default-ticker.js.map +1 -1
  4. package/cjs/animate/custom-animate.d.ts +2 -0
  5. package/cjs/animate/custom-animate.js +11 -2
  6. package/cjs/animate/custom-animate.js.map +1 -1
  7. package/cjs/core/contributions/textMeasure/AtextMeasure.d.ts +56 -4
  8. package/cjs/core/contributions/textMeasure/AtextMeasure.js +112 -14
  9. package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  10. package/cjs/core/contributions/textMeasure/layout.d.ts +6 -2
  11. package/cjs/core/contributions/textMeasure/layout.js +26 -34
  12. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  13. package/cjs/core/stage.d.ts +2 -0
  14. package/cjs/core/stage.js +9 -5
  15. package/cjs/core/stage.js.map +1 -1
  16. package/cjs/graphic/builtin-symbol/arrow.js +2 -2
  17. package/cjs/graphic/builtin-symbol/arrow.js.map +1 -1
  18. package/cjs/graphic/builtin-symbol/arrow2-down.js +2 -2
  19. package/cjs/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  20. package/cjs/graphic/builtin-symbol/arrow2-left.js +2 -2
  21. package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  22. package/cjs/graphic/builtin-symbol/arrow2-right.js +2 -2
  23. package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  24. package/cjs/graphic/builtin-symbol/arrow2-up.js +2 -2
  25. package/cjs/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  26. package/cjs/graphic/builtin-symbol/base.d.ts +1 -0
  27. package/cjs/graphic/builtin-symbol/base.js +3 -0
  28. package/cjs/graphic/builtin-symbol/base.js.map +1 -1
  29. package/cjs/graphic/builtin-symbol/circle.js +3 -3
  30. package/cjs/graphic/builtin-symbol/circle.js.map +1 -1
  31. package/cjs/graphic/builtin-symbol/close.js +3 -3
  32. package/cjs/graphic/builtin-symbol/close.js.map +1 -1
  33. package/cjs/graphic/builtin-symbol/cross.js +2 -2
  34. package/cjs/graphic/builtin-symbol/cross.js.map +1 -1
  35. package/cjs/graphic/builtin-symbol/diamond.js +3 -3
  36. package/cjs/graphic/builtin-symbol/diamond.js.map +1 -1
  37. package/cjs/graphic/builtin-symbol/line-h.js +3 -3
  38. package/cjs/graphic/builtin-symbol/line-h.js.map +1 -1
  39. package/cjs/graphic/builtin-symbol/line-v.js +3 -3
  40. package/cjs/graphic/builtin-symbol/line-v.js.map +1 -1
  41. package/cjs/graphic/builtin-symbol/square.js +2 -2
  42. package/cjs/graphic/builtin-symbol/square.js.map +1 -1
  43. package/cjs/graphic/builtin-symbol/star.js +2 -2
  44. package/cjs/graphic/builtin-symbol/star.js.map +1 -1
  45. package/cjs/graphic/builtin-symbol/stroke.js +2 -2
  46. package/cjs/graphic/builtin-symbol/stroke.js.map +1 -1
  47. package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -2
  48. package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  49. package/cjs/graphic/builtin-symbol/triangle-down.js +2 -2
  50. package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
  51. package/cjs/graphic/builtin-symbol/triangle-left.js +2 -2
  52. package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
  53. package/cjs/graphic/builtin-symbol/triangle-right.js +2 -2
  54. package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
  55. package/cjs/graphic/builtin-symbol/triangle-up.js +2 -2
  56. package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
  57. package/cjs/graphic/builtin-symbol/utils.d.ts +1 -0
  58. package/cjs/graphic/builtin-symbol/utils.js +6 -3
  59. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  60. package/cjs/graphic/builtin-symbol/wedge.js +2 -2
  61. package/cjs/graphic/builtin-symbol/wedge.js.map +1 -1
  62. package/cjs/graphic/builtin-symbol/wye.js +2 -2
  63. package/cjs/graphic/builtin-symbol/wye.js.map +1 -1
  64. package/cjs/graphic/config.d.ts +1 -1
  65. package/cjs/graphic/config.js +6 -3
  66. package/cjs/graphic/config.js.map +1 -1
  67. package/cjs/graphic/richtext/paragraph.js +3 -1
  68. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  69. package/cjs/graphic/text.d.ts +11 -11
  70. package/cjs/graphic/text.js +98 -169
  71. package/cjs/graphic/text.js.map +1 -1
  72. package/cjs/graphic/wrap-text.js +12 -4
  73. package/cjs/graphic/wrap-text.js.map +1 -1
  74. package/cjs/interface/animate.d.ts +3 -1
  75. package/cjs/interface/animate.js.map +1 -1
  76. package/cjs/interface/context.d.ts +1 -0
  77. package/cjs/interface/context.js.map +1 -1
  78. package/cjs/interface/graphic/text.d.ts +9 -3
  79. package/cjs/interface/graphic/text.js +6 -1
  80. package/cjs/interface/graphic/text.js.map +1 -1
  81. package/cjs/interface/graphic.d.ts +1 -0
  82. package/cjs/interface/graphic.js.map +1 -1
  83. package/cjs/interface/stage.d.ts +1 -0
  84. package/cjs/interface/stage.js.map +1 -1
  85. package/cjs/interface/text.d.ts +9 -1
  86. package/cjs/interface/text.js.map +1 -1
  87. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  88. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  89. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  90. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  91. package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +1 -1
  92. package/cjs/render/contributions/render/contributions/image-contribution-render.js +2 -3
  93. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  94. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  95. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  96. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  97. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  98. package/cjs/render/contributions/render/image-render.js +4 -6
  99. package/cjs/render/contributions/render/image-render.js.map +1 -1
  100. package/cjs/render/contributions/render/text-render.d.ts +1 -1
  101. package/cjs/render/contributions/render/text-render.js +24 -46
  102. package/cjs/render/contributions/render/text-render.js.map +1 -1
  103. package/cjs/resource-loader/loader.js +1 -1
  104. package/cjs/resource-loader/loader.js.map +1 -1
  105. package/dist/index.es.js +532 -536
  106. package/es/animate/Ticker/default-ticker.d.ts +4 -2
  107. package/es/animate/Ticker/default-ticker.js +9 -6
  108. package/es/animate/Ticker/default-ticker.js.map +1 -1
  109. package/es/animate/custom-animate.d.ts +2 -0
  110. package/es/animate/custom-animate.js +11 -2
  111. package/es/animate/custom-animate.js.map +1 -1
  112. package/es/core/contributions/textMeasure/AtextMeasure.d.ts +56 -4
  113. package/es/core/contributions/textMeasure/AtextMeasure.js +113 -13
  114. package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  115. package/es/core/contributions/textMeasure/layout.d.ts +6 -2
  116. package/es/core/contributions/textMeasure/layout.js +26 -34
  117. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  118. package/es/core/stage.d.ts +2 -0
  119. package/es/core/stage.js +9 -5
  120. package/es/core/stage.js.map +1 -1
  121. package/es/graphic/builtin-symbol/arrow.js +2 -2
  122. package/es/graphic/builtin-symbol/arrow.js.map +1 -1
  123. package/es/graphic/builtin-symbol/arrow2-down.js +2 -2
  124. package/es/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  125. package/es/graphic/builtin-symbol/arrow2-left.js +2 -2
  126. package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  127. package/es/graphic/builtin-symbol/arrow2-right.js +2 -2
  128. package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  129. package/es/graphic/builtin-symbol/arrow2-up.js +2 -2
  130. package/es/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  131. package/es/graphic/builtin-symbol/base.d.ts +1 -0
  132. package/es/graphic/builtin-symbol/base.js +3 -0
  133. package/es/graphic/builtin-symbol/base.js.map +1 -1
  134. package/es/graphic/builtin-symbol/circle.js +3 -3
  135. package/es/graphic/builtin-symbol/circle.js.map +1 -1
  136. package/es/graphic/builtin-symbol/close.js +3 -3
  137. package/es/graphic/builtin-symbol/close.js.map +1 -1
  138. package/es/graphic/builtin-symbol/cross.js +2 -2
  139. package/es/graphic/builtin-symbol/cross.js.map +1 -1
  140. package/es/graphic/builtin-symbol/diamond.js +3 -3
  141. package/es/graphic/builtin-symbol/diamond.js.map +1 -1
  142. package/es/graphic/builtin-symbol/line-h.js +3 -3
  143. package/es/graphic/builtin-symbol/line-h.js.map +1 -1
  144. package/es/graphic/builtin-symbol/line-v.js +3 -3
  145. package/es/graphic/builtin-symbol/line-v.js.map +1 -1
  146. package/es/graphic/builtin-symbol/square.js +2 -2
  147. package/es/graphic/builtin-symbol/square.js.map +1 -1
  148. package/es/graphic/builtin-symbol/star.js +2 -2
  149. package/es/graphic/builtin-symbol/star.js.map +1 -1
  150. package/es/graphic/builtin-symbol/stroke.js +2 -2
  151. package/es/graphic/builtin-symbol/stroke.js.map +1 -1
  152. package/es/graphic/builtin-symbol/thin-triangle.js +2 -2
  153. package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  154. package/es/graphic/builtin-symbol/triangle-down.js +2 -2
  155. package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
  156. package/es/graphic/builtin-symbol/triangle-left.js +2 -2
  157. package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
  158. package/es/graphic/builtin-symbol/triangle-right.js +2 -2
  159. package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
  160. package/es/graphic/builtin-symbol/triangle-up.js +2 -2
  161. package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
  162. package/es/graphic/builtin-symbol/utils.d.ts +1 -0
  163. package/es/graphic/builtin-symbol/utils.js +7 -4
  164. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  165. package/es/graphic/builtin-symbol/wedge.js +2 -2
  166. package/es/graphic/builtin-symbol/wedge.js.map +1 -1
  167. package/es/graphic/builtin-symbol/wye.js +2 -2
  168. package/es/graphic/builtin-symbol/wye.js.map +1 -1
  169. package/es/graphic/config.d.ts +1 -1
  170. package/es/graphic/config.js +7 -2
  171. package/es/graphic/config.js.map +1 -1
  172. package/es/graphic/richtext/paragraph.js +4 -2
  173. package/es/graphic/richtext/paragraph.js.map +1 -1
  174. package/es/graphic/text.d.ts +11 -11
  175. package/es/graphic/text.js +97 -164
  176. package/es/graphic/text.js.map +1 -1
  177. package/es/graphic/wrap-text.js +12 -4
  178. package/es/graphic/wrap-text.js.map +1 -1
  179. package/es/interface/animate.d.ts +3 -1
  180. package/es/interface/animate.js.map +1 -1
  181. package/es/interface/context.d.ts +1 -0
  182. package/es/interface/context.js.map +1 -1
  183. package/es/interface/graphic/text.d.ts +9 -3
  184. package/es/interface/graphic/text.js +6 -1
  185. package/es/interface/graphic/text.js.map +1 -1
  186. package/es/interface/graphic.d.ts +1 -0
  187. package/es/interface/graphic.js.map +1 -1
  188. package/es/interface/stage.d.ts +1 -0
  189. package/es/interface/stage.js.map +1 -1
  190. package/es/interface/text.d.ts +9 -1
  191. package/es/interface/text.js.map +1 -1
  192. package/es/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  193. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  194. package/es/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  195. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  196. package/es/render/contributions/render/contributions/image-contribution-render.d.ts +1 -1
  197. package/es/render/contributions/render/contributions/image-contribution-render.js +2 -3
  198. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  199. package/es/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  200. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  201. package/es/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  202. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  203. package/es/render/contributions/render/image-render.js +4 -6
  204. package/es/render/contributions/render/image-render.js.map +1 -1
  205. package/es/render/contributions/render/text-render.d.ts +1 -1
  206. package/es/render/contributions/render/text-render.js +23 -45
  207. package/es/render/contributions/render/text-render.js.map +1 -1
  208. package/es/resource-loader/loader.js +1 -1
  209. package/es/resource-loader/loader.js.map +1 -1
  210. package/package.json +6 -5
package/dist/index.es.js CHANGED
@@ -1156,6 +1156,32 @@ DefaultGlobal = __decorate([
1156
1156
  __metadata("design:paramtypes", [Object])
1157
1157
  ], DefaultGlobal);
1158
1158
 
1159
+ var params;
1160
+ (function (params) {
1161
+ params[params["W"] = 1] = "W";
1162
+ params[params["H"] = 2] = "H";
1163
+ params[params["WH"] = 3] = "WH";
1164
+ })(params || (params = {}));
1165
+
1166
+ var MeasureModeEnum;
1167
+ (function (MeasureModeEnum) {
1168
+ MeasureModeEnum[MeasureModeEnum["estimate"] = 0] = "estimate";
1169
+ MeasureModeEnum[MeasureModeEnum["actualBounding"] = 1] = "actualBounding";
1170
+ MeasureModeEnum[MeasureModeEnum["fontBounding"] = 2] = "fontBounding";
1171
+ })(MeasureModeEnum || (MeasureModeEnum = {}));
1172
+
1173
+ const strCommandMap = [
1174
+ 'arc',
1175
+ 'arcTo',
1176
+ 'bezierCurveTo',
1177
+ 'closePath',
1178
+ 'ellipse',
1179
+ 'lineTo',
1180
+ 'moveTo',
1181
+ 'quadraticCurveTo',
1182
+ 'rect'
1183
+ ];
1184
+
1159
1185
  const circleThreshold = tau - 1e-8;
1160
1186
  class BoundsContext {
1161
1187
  constructor(bounds) {
@@ -3016,6 +3042,7 @@ const DefaultStrokeStyle = Object.assign({ outerBorder: Object.assign(Object.ass
3016
3042
  const DefaultTextStyle = {
3017
3043
  text: '',
3018
3044
  maxLineWidth: Infinity,
3045
+ maxWidth: Infinity,
3019
3046
  textAlign: 'left',
3020
3047
  textBaseline: 'alphabetic',
3021
3048
  fontSize: 16,
@@ -3040,7 +3067,8 @@ const DefaultTextStyle = {
3040
3067
  suffixPosition: 'end',
3041
3068
  underlineDash: [],
3042
3069
  underlineOffset: 0,
3043
- disableAutoClipedPoptip: undefined
3070
+ disableAutoClipedPoptip: undefined,
3071
+ measureMode: MeasureModeEnum.fontBounding
3044
3072
  };
3045
3073
  const DefaultPickStyle = {
3046
3074
  pickStrokeBuffer: 0
@@ -3055,7 +3083,7 @@ const DefaultConnectAttribute = {
3055
3083
  const DefaultDebugAttribute = {
3056
3084
  _debug_bounds: false
3057
3085
  };
3058
- const DefaultAttribute = Object.assign(Object.assign(Object.assign({ strokeSeg: null, renderable: true, pickable: true, shadowGraphic: undefined, childrenPickable: true, fillPickable: true, strokePickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, fillStrokeOrder: 0, renderStyle: 'default', pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true, shadowRootIdx: 1, globalZIndex: 1, globalCompositeOperation: '', overflow: 'hidden', shadowPickMode: 'graphic' }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
3086
+ const DefaultAttribute = Object.assign(Object.assign(Object.assign({ strokeSeg: null, renderable: true, pickable: true, shadowGraphic: undefined, childrenPickable: true, fillPickable: true, strokePickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, fillStrokeOrder: 0, renderStyle: 'default', pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true, shadowRootIdx: 1, globalZIndex: 1, globalCompositeOperation: '', overflow: 'hidden', shadowPickMode: 'graphic', keepStrokeScale: false }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
3059
3087
  function addAttributeToPrototype(obj, c, keys) {
3060
3088
  keys.forEach(key => {
3061
3089
  c.prototype[key] = obj[key];
@@ -3249,13 +3277,33 @@ let ATextMeasure = class ATextMeasure {
3249
3277
  this.context = service.context;
3250
3278
  service.bindTextMeasure(this);
3251
3279
  }
3252
- measureTextWidth(text, options) {
3253
- if (!this.context) {
3254
- return this.estimate(text, options).width;
3255
- }
3280
+ _measureTextWithoutAlignBaseline(text, options, compatible) {
3256
3281
  this.context.setTextStyleWithoutAlignBaseline(options);
3257
- const textMeasure = this.context.measureText(text);
3258
- return textMeasure.width;
3282
+ const metrics = this.context.measureText(text);
3283
+ return compatible ? this.compatibleMetrics(metrics, options) : metrics;
3284
+ }
3285
+ _measureTextWithAlignBaseline(text, options, compatible) {
3286
+ this.context.setTextStyle(options);
3287
+ const metrics = this.context.measureText(text);
3288
+ return compatible ? this.compatibleMetrics(metrics, options) : metrics;
3289
+ }
3290
+ compatibleMetrics(metrics, options) {
3291
+ if (metrics.actualBoundingBoxAscent == null ||
3292
+ metrics.actualBoundingBoxDescent == null ||
3293
+ metrics.fontBoundingBoxAscent == null ||
3294
+ metrics.fontBoundingBoxDescent == null) {
3295
+ const { ascent, descent } = this.measureTextBoundADscentEstimate(options);
3296
+ metrics.actualBoundingBoxAscent = ascent;
3297
+ metrics.actualBoundingBoxDescent = descent;
3298
+ metrics.fontBoundingBoxAscent = ascent;
3299
+ metrics.fontBoundingBoxDescent = descent;
3300
+ }
3301
+ if (metrics.actualBoundingBoxLeft == null || metrics.actualBoundingBoxRight == null) {
3302
+ const { left, right } = this.measureTextBoundLeftRightEstimate(options);
3303
+ metrics.actualBoundingBoxLeft = left;
3304
+ metrics.actualBoundingBoxRight = right;
3305
+ }
3306
+ return metrics;
3259
3307
  }
3260
3308
  estimate(text, { fontSize = DefaultTextAttribute.fontSize }) {
3261
3309
  let eCharLen = 0;
@@ -3268,24 +3316,141 @@ let ATextMeasure = class ATextMeasure {
3268
3316
  height: fontSize
3269
3317
  };
3270
3318
  }
3271
- measureTextPixelHeight(text, options) {
3319
+ measureTextWidth(text, options, textMeasure) {
3320
+ if (!this.context) {
3321
+ return this.estimate(text, options).width;
3322
+ }
3323
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options);
3324
+ return textMeasure.width;
3325
+ }
3326
+ measureTextBoundsWidth(text, options, textMeasure) {
3327
+ if (!this.context) {
3328
+ return this.estimate(text, options).width;
3329
+ }
3330
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options);
3331
+ return textMeasure.width;
3332
+ }
3333
+ measureTextBoundsLeftRight(text, options, textMeasure) {
3334
+ if (!this.context) {
3335
+ return this.measureTextBoundLeftRightEstimate(options);
3336
+ }
3337
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithAlignBaseline(text, options, true);
3338
+ return {
3339
+ left: textMeasure.actualBoundingBoxLeft,
3340
+ right: textMeasure.actualBoundingBoxRight
3341
+ };
3342
+ }
3343
+ measureTextPixelHeight(text, options, textMeasure) {
3272
3344
  var _a;
3273
3345
  if (!this.context) {
3274
3346
  return (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
3275
3347
  }
3276
- this.context.setTextStyleWithoutAlignBaseline(options);
3277
- const textMeasure = this.context.measureText(text);
3348
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options, true);
3278
3349
  return Math.abs(textMeasure.actualBoundingBoxAscent - textMeasure.actualBoundingBoxDescent);
3279
3350
  }
3280
- measureTextBoundHieght(text, options) {
3351
+ measureTextPixelADscent(text, options, textMeasure) {
3352
+ if (!this.context) {
3353
+ return this.measureTextBoundADscentEstimate(options);
3354
+ }
3355
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithAlignBaseline(text, options, true);
3356
+ return {
3357
+ ascent: textMeasure.actualBoundingBoxAscent,
3358
+ descent: textMeasure.actualBoundingBoxDescent
3359
+ };
3360
+ }
3361
+ measureTextBoundHieght(text, options, textMeasure) {
3281
3362
  var _a;
3282
3363
  if (!this.context) {
3283
3364
  return (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
3284
3365
  }
3285
- this.context.setTextStyleWithoutAlignBaseline(options);
3286
- const textMeasure = this.context.measureText(text);
3366
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options, true);
3287
3367
  return Math.abs(textMeasure.fontBoundingBoxAscent - textMeasure.fontBoundingBoxDescent);
3288
3368
  }
3369
+ measureTextBoundADscent(text, options, textMeasure) {
3370
+ if (!this.context) {
3371
+ return this.measureTextBoundADscentEstimate(options);
3372
+ }
3373
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithAlignBaseline(text, options, true);
3374
+ return {
3375
+ ascent: textMeasure.fontBoundingBoxAscent,
3376
+ descent: textMeasure.fontBoundingBoxDescent
3377
+ };
3378
+ }
3379
+ measureTextBoundADscentEstimate(options) {
3380
+ var _a;
3381
+ const fontSize = (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
3382
+ return {
3383
+ ascent: 0.79 * fontSize,
3384
+ descent: 0.21 * fontSize
3385
+ };
3386
+ }
3387
+ measureTextBoundLeftRightEstimate(options) {
3388
+ var _a;
3389
+ const fontSize = (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
3390
+ const { textAlign } = options;
3391
+ if (textAlign === 'center') {
3392
+ return {
3393
+ left: fontSize / 2,
3394
+ right: fontSize / 2
3395
+ };
3396
+ }
3397
+ else if (textAlign === 'right' || textAlign === 'end') {
3398
+ return {
3399
+ left: fontSize,
3400
+ right: 0
3401
+ };
3402
+ }
3403
+ return {
3404
+ left: 0,
3405
+ right: fontSize
3406
+ };
3407
+ }
3408
+ measureTextPixelADscentAndWidth(text, options, mode) {
3409
+ if (!this.context) {
3410
+ return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), { width: this.estimate(text, options).width });
3411
+ }
3412
+ const out = this._measureTextWithoutAlignBaseline(text, options, true);
3413
+ if (mode === MeasureModeEnum.actualBounding) {
3414
+ return {
3415
+ ascent: out.actualBoundingBoxAscent,
3416
+ descent: out.actualBoundingBoxDescent,
3417
+ width: out.width
3418
+ };
3419
+ }
3420
+ else if (mode === MeasureModeEnum.estimate) {
3421
+ return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), { width: out.width });
3422
+ }
3423
+ else if (mode === MeasureModeEnum.fontBounding) {
3424
+ const { lineHeight = options.fontSize } = options;
3425
+ let ratio = 1;
3426
+ if (lineHeight) {
3427
+ const fontBoundingHeight = out.fontBoundingBoxAscent + out.fontBoundingBoxDescent;
3428
+ ratio = lineHeight / fontBoundingHeight;
3429
+ }
3430
+ let ascent = out.fontBoundingBoxAscent * ratio;
3431
+ let descent = out.fontBoundingBoxDescent * ratio;
3432
+ if (out.actualBoundingBoxDescent && descent < out.actualBoundingBoxDescent) {
3433
+ const delta = out.actualBoundingBoxDescent - descent;
3434
+ descent += delta;
3435
+ ascent -= delta;
3436
+ }
3437
+ else if (out.actualBoundingBoxAscent && ascent < out.actualBoundingBoxAscent) {
3438
+ const delta = out.actualBoundingBoxAscent - ascent;
3439
+ ascent += delta;
3440
+ descent -= delta;
3441
+ }
3442
+ return {
3443
+ ascent,
3444
+ descent,
3445
+ width: out.width
3446
+ };
3447
+ }
3448
+ return {
3449
+ ascent: out.actualBoundingBoxAscent,
3450
+ descent: out.actualBoundingBoxDescent,
3451
+ width: out.width
3452
+ };
3453
+ }
3289
3454
  measureText(text, options) {
3290
3455
  if (!this.context) {
3291
3456
  return this.estimate(text, options);
@@ -6841,7 +7006,7 @@ class TimeOutTickHandler {
6841
7006
  }
6842
7007
  }
6843
7008
 
6844
- class DefaultTicker {
7009
+ class DefaultTicker extends EventEmitter {
6845
7010
  set mode(m) {
6846
7011
  if (this._mode === m) {
6847
7012
  return;
@@ -6853,18 +7018,19 @@ class DefaultTicker {
6853
7018
  return this._mode;
6854
7019
  }
6855
7020
  constructor(timelines = []) {
7021
+ super();
6856
7022
  this.handleTick = (handler, params) => {
6857
7023
  const { once = false } = params !== null && params !== void 0 ? params : {};
6858
7024
  if (this.ifCanStop()) {
6859
7025
  this.stop();
6860
7026
  return;
6861
7027
  }
6862
- this._handlerTick(handler);
7028
+ this._handlerTick();
6863
7029
  if (!once) {
6864
7030
  handler.tick(this.interval, this.handleTick);
6865
7031
  }
6866
7032
  };
6867
- this._handlerTick = (handler) => {
7033
+ this._handlerTick = () => {
6868
7034
  const tickerHandler = this.tickerHandler;
6869
7035
  const time = tickerHandler.getTime();
6870
7036
  let delta = 0;
@@ -6879,6 +7045,7 @@ class DefaultTicker {
6879
7045
  this.timelines.forEach(t => {
6880
7046
  t.tick(delta);
6881
7047
  });
7048
+ this.emit('afterTick');
6882
7049
  };
6883
7050
  this.init();
6884
7051
  this.lastFrameTime = -1;
@@ -7018,6 +7185,11 @@ class DefaultTicker {
7018
7185
  this.setupTickHandler();
7019
7186
  this.lastFrameTime = -1;
7020
7187
  }
7188
+ trySyncTickStatus() {
7189
+ if (this.status === STATUS$1.RUNNING) {
7190
+ this._handlerTick();
7191
+ }
7192
+ }
7021
7193
  }
7022
7194
 
7023
7195
  class ManualTickHandler {
@@ -8838,6 +9010,11 @@ class TagPointsUpdate extends ACustomAnimate {
8838
9010
  this.clipRange =
8839
9011
  this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /
8840
9012
  this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension];
9013
+ if (this.clipRange === 1) {
9014
+ this.shrinkClipRange =
9015
+ this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /
9016
+ this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension];
9017
+ }
8841
9018
  if (!isValidNumber(this.clipRange)) {
8842
9019
  this.clipRange = 0;
8843
9020
  }
@@ -8877,6 +9054,12 @@ class TagPointsUpdate extends ACustomAnimate {
8877
9054
  return newPoint;
8878
9055
  });
8879
9056
  }
9057
+ onFirstRun() {
9058
+ const lastClipRange = this.target.attribute.clipRange;
9059
+ if (isValidNumber(lastClipRange * this.clipRange)) {
9060
+ this.clipRange *= lastClipRange;
9061
+ }
9062
+ }
8880
9063
  onUpdate(end, ratio, out) {
8881
9064
  this.points = this.points.map((point, index) => {
8882
9065
  const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
@@ -8884,6 +9067,17 @@ class TagPointsUpdate extends ACustomAnimate {
8884
9067
  return newPoint;
8885
9068
  });
8886
9069
  if (this.clipRange) {
9070
+ if (this.shrinkClipRange) {
9071
+ if (!end) {
9072
+ out.points = this.fromPoints;
9073
+ out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio;
9074
+ }
9075
+ else {
9076
+ out.points = this.toPoints;
9077
+ out.clipRange = 1;
9078
+ }
9079
+ return;
9080
+ }
8887
9081
  out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
8888
9082
  }
8889
9083
  if (this.segmentsCache && this.to.segments) {
@@ -10810,10 +11004,10 @@ class ResourceLoader {
10810
11004
  static GetFile(url, type) {
10811
11005
  let data = ResourceLoader.cache.get(url);
10812
11006
  if (data) {
10813
- if (data.loadState === 'fail') {
11007
+ if (data.loadState === 'init' || data.loadState === 'fail') {
10814
11008
  return Promise.reject();
10815
11009
  }
10816
- else if (data.loadState === 'init' || data.loadState === 'loading') {
11010
+ else if (data.loadState === 'loading') {
10817
11011
  return data.dataPromise.then(data => data.data);
10818
11012
  }
10819
11013
  return Promise.resolve(data.data);
@@ -15409,14 +15603,14 @@ class DefaultArcRenderContribution {
15409
15603
  if (!(doOuterBorder || doInnerBorder)) {
15410
15604
  return;
15411
15605
  }
15412
- const { innerPadding = arcAttribute.innerPadding, outerPadding = arcAttribute.outerPadding, startAngle = arcAttribute.startAngle, endAngle = arcAttribute.endAngle, opacity = arcAttribute.opacity, x: originX = arcAttribute.x, y: originY = arcAttribute.y, scaleX = arcAttribute.scaleX, scaleY = arcAttribute.scaleY } = arc.attribute;
15606
+ const { innerPadding = arcAttribute.innerPadding, outerPadding = arcAttribute.outerPadding, startAngle = arcAttribute.startAngle, endAngle = arcAttribute.endAngle, opacity = arcAttribute.opacity, x: originX = arcAttribute.x, y: originY = arcAttribute.y, scaleX = arcAttribute.scaleX, scaleY = arcAttribute.scaleY, keepStrokeScale = arcAttribute.keepStrokeScale } = arc.attribute;
15413
15607
  let { innerRadius = arcAttribute.innerRadius, outerRadius = arcAttribute.outerRadius } = arc.attribute;
15414
15608
  outerRadius += outerPadding;
15415
15609
  innerRadius -= innerPadding;
15416
15610
  const renderBorder = (borderStyle, key) => {
15417
15611
  const doStroke = !!(borderStyle && borderStyle.stroke);
15418
15612
  const { distance = arcAttribute[key].distance } = borderStyle;
15419
- const d = getScaledStroke(context, distance, context.dpr);
15613
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15420
15614
  const deltaAngle = distance / outerRadius;
15421
15615
  const sign = key === 'outerBorder' ? 1 : -1;
15422
15616
  arc.setAttributes({
@@ -15461,11 +15655,11 @@ class DefaultCircleRenderContribution {
15461
15655
  if (!(doOuterBorder || doInnerBorder)) {
15462
15656
  return;
15463
15657
  }
15464
- const { radius = circleAttribute.radius, startAngle = circleAttribute.startAngle, endAngle = circleAttribute.endAngle, opacity = circleAttribute.opacity, x: originX = circleAttribute.x, y: originY = circleAttribute.y, scaleX = circleAttribute.scaleX, scaleY = circleAttribute.scaleY } = circle.attribute;
15658
+ const { radius = circleAttribute.radius, startAngle = circleAttribute.startAngle, endAngle = circleAttribute.endAngle, opacity = circleAttribute.opacity, x: originX = circleAttribute.x, y: originY = circleAttribute.y, scaleX = circleAttribute.scaleX, scaleY = circleAttribute.scaleY, keepStrokeScale = circleAttribute.keepStrokeScale } = circle.attribute;
15465
15659
  const renderBorder = (borderStyle, key) => {
15466
15660
  const doStroke = !!(borderStyle && borderStyle.stroke);
15467
15661
  const { distance = circleAttribute[key].distance } = borderStyle;
15468
- const d = getScaledStroke(context, distance, context.dpr);
15662
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15469
15663
  const sign = key === 'outerBorder' ? 1 : -1;
15470
15664
  context.beginPath();
15471
15665
  context.arc(x, y, radius + sign * d, startAngle, endAngle);
@@ -15650,7 +15844,7 @@ class DefaultRectRenderContribution {
15650
15844
  if (!(doOuterBorder || doInnerBorder)) {
15651
15845
  return;
15652
15846
  }
15653
- const { cornerRadius = rectAttribute.cornerRadius, opacity = rectAttribute.opacity, x: originX = rectAttribute.x, y: originY = rectAttribute.y, scaleX = rectAttribute.scaleX, scaleY = rectAttribute.scaleY, x1, y1 } = rect.attribute;
15847
+ const { cornerRadius = rectAttribute.cornerRadius, opacity = rectAttribute.opacity, x: originX = rectAttribute.x, y: originY = rectAttribute.y, scaleX = rectAttribute.scaleX, scaleY = rectAttribute.scaleY, x1, y1, keepStrokeScale = rectAttribute.keepStrokeScale } = rect.attribute;
15654
15848
  let { width, height } = rect.attribute;
15655
15849
  width = (width !== null && width !== void 0 ? width : x1 - x) || 0;
15656
15850
  height = (height !== null && height !== void 0 ? height : y1 - y) || 0;
@@ -15658,7 +15852,7 @@ class DefaultRectRenderContribution {
15658
15852
  const doStroke = !!(borderStyle && borderStyle.stroke);
15659
15853
  const sign = key === 'outerBorder' ? -1 : 1;
15660
15854
  const { distance = rectAttribute[key].distance } = borderStyle;
15661
- const d = getScaledStroke(context, distance, context.dpr);
15855
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15662
15856
  const nextX = x + sign * d;
15663
15857
  const nextY = y + sign * d;
15664
15858
  const dw = d * 2;
@@ -15874,13 +16068,8 @@ class DefaultImageRenderContribution extends DefaultRectRenderContribution {
15874
16068
  this.useStyle = true;
15875
16069
  this.order = 0;
15876
16070
  }
15877
- drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
15878
- if (image.isGifImage && image.renderFrame && image.playing) {
15879
- image.renderFrame(context, x, y);
15880
- }
15881
- else {
15882
- return super.drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
15883
- }
16071
+ drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
16072
+ return super.drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
15884
16073
  }
15885
16074
  }
15886
16075
  const defaultImageRenderContribution = new DefaultImageRenderContribution();
@@ -15903,11 +16092,11 @@ class DefaultSymbolRenderContribution {
15903
16092
  if (!(doOuterBorder || doInnerBorder)) {
15904
16093
  return;
15905
16094
  }
15906
- const { size = symbolAttribute.size, opacity = symbolAttribute.opacity, x: originX = symbolAttribute.x, y: originY = symbolAttribute.y, scaleX = symbolAttribute.scaleX, scaleY = symbolAttribute.scaleY } = symbol.attribute;
16095
+ const { size = symbolAttribute.size, opacity = symbolAttribute.opacity, x: originX = symbolAttribute.x, y: originY = symbolAttribute.y, scaleX = symbolAttribute.scaleX, scaleY = symbolAttribute.scaleY, keepStrokeScale = symbolAttribute.keepStrokeScale } = symbol.attribute;
15907
16096
  const renderBorder = (borderStyle, key) => {
15908
16097
  const doStroke = !!(borderStyle && borderStyle.stroke);
15909
16098
  const { distance = symbolAttribute[key].distance } = borderStyle;
15910
- const d = getScaledStroke(context, distance, context.dpr);
16099
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15911
16100
  const sign = key === 'outerBorder' ? 1 : -1;
15912
16101
  context.beginPath();
15913
16102
  if (parsedPath.drawOffset(context, size, x, y, sign * d) === false) {
@@ -17796,13 +17985,7 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17796
17985
  var _a, _b, _c;
17797
17986
  const textAttribute = getTheme(text, params === null || params === void 0 ? void 0 : params.theme).text;
17798
17987
  const { text: str, underline = textAttribute.underline, lineThrough = textAttribute.lineThrough, keepDirIn3d = textAttribute.keepDirIn3d, direction = textAttribute.direction, fontSize = textAttribute.fontSize, verticalMode = textAttribute.verticalMode, x: originX = textAttribute.x, y: originY = textAttribute.y } = text.attribute;
17799
- let { textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline } = text.attribute;
17800
- if (!verticalMode && direction === 'vertical') {
17801
- const t = textAlign;
17802
- textAlign = (_a = text.getBaselineMapAlign()[textBaseline]) !== null && _a !== void 0 ? _a : 'left';
17803
- textBaseline = (_b = text.getAlignMapBaseline()[t]) !== null && _b !== void 0 ? _b : 'top';
17804
- }
17805
- const lineHeight = (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) !== null && _c !== void 0 ? _c : fontSize;
17988
+ const lineHeight = (_a = calculateLineHeight(text.attribute.lineHeight, fontSize)) !== null && _a !== void 0 ? _a : fontSize;
17806
17989
  const data = this.valid(text, textAttribute, fillCb, strokeCb);
17807
17990
  if (!data) {
17808
17991
  return;
@@ -17841,7 +18024,6 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17841
18024
  else if (fVisible) {
17842
18025
  context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
17843
18026
  context.fillText(t, _x, _y, z);
17844
- this.drawUnderLine(underline, lineThrough, text, _x, _y, z, textAttribute, context);
17845
18027
  }
17846
18028
  }
17847
18029
  if (direction) {
@@ -17849,132 +18031,88 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17849
18031
  context.setTransformForCurrent();
17850
18032
  }
17851
18033
  };
17852
- if (text.isMultiLine) {
17853
- context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
17854
- if (direction === 'horizontal') {
17855
- const { multilineLayout } = text;
17856
- if (!multilineLayout) {
17857
- context.highPerformanceRestore();
17858
- return;
17859
- }
17860
- const { xOffset, yOffset } = multilineLayout.bbox;
17861
- if (doStroke) {
17862
- if (strokeCb) {
17863
- strokeCb(context, text.attribute, textAttribute);
17864
- }
17865
- else if (sVisible) {
17866
- context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute);
17867
- multilineLayout.lines.forEach(line => {
17868
- context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
17869
- });
17870
- }
17871
- }
17872
- if (doFill) {
17873
- if (fillCb) {
17874
- fillCb(context, text.attribute, textAttribute);
17875
- }
17876
- else if (fVisible) {
17877
- context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
17878
- multilineLayout.lines.forEach(line => {
17879
- context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
17880
- this.drawUnderLine(underline, lineThrough, text, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y - textDrawOffsetY('bottom', fontSize) - 0.05 * fontSize, z, textAttribute, context, {
17881
- width: line.width
17882
- });
17883
- });
17884
- }
17885
- }
18034
+ context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
18035
+ if (direction === 'horizontal') {
18036
+ const { multilineLayout } = text;
18037
+ if (!multilineLayout) {
18038
+ context.highPerformanceRestore();
18039
+ return;
17886
18040
  }
17887
- else {
17888
- text.tryUpdateAABBBounds();
17889
- const cache = text.cache;
17890
- const { verticalList } = cache;
17891
- context.textAlign = 'left';
17892
- context.textBaseline = 'top';
17893
- const totalHeight = lineHeight * verticalList.length;
17894
- let totalW = 0;
17895
- verticalList.forEach(verticalData => {
17896
- const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
17897
- totalW = max(_w, totalW);
17898
- });
17899
- let offsetY = 0;
17900
- let offsetX = 0;
17901
- if (textBaseline === 'bottom') {
17902
- offsetX = -totalHeight;
18041
+ const { xOffset, yOffset } = multilineLayout.bbox;
18042
+ if (doStroke) {
18043
+ if (strokeCb) {
18044
+ strokeCb(context, text.attribute, textAttribute);
17903
18045
  }
17904
- else if (textBaseline === 'middle') {
17905
- offsetX = -totalHeight / 2;
18046
+ else if (sVisible) {
18047
+ context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute);
18048
+ multilineLayout.lines.forEach(line => {
18049
+ context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
18050
+ });
17906
18051
  }
17907
- if (textAlign === 'center') {
17908
- offsetY -= totalW / 2;
18052
+ }
18053
+ if (doFill) {
18054
+ if (fillCb) {
18055
+ fillCb(context, text.attribute, textAttribute);
17909
18056
  }
17910
- else if (textAlign === 'right') {
17911
- offsetY -= totalW;
17912
- }
17913
- verticalList.forEach((verticalData, i) => {
17914
- const currentW = verticalData.reduce((a, b) => a + (b.width || 0), 0);
17915
- const dw = totalW - currentW;
17916
- let currentOffsetY = offsetY;
17917
- if (textAlign === 'center') {
17918
- currentOffsetY += dw / 2;
17919
- }
17920
- else if (textAlign === 'right') {
17921
- currentOffsetY += dw;
17922
- }
17923
- verticalData.forEach(item => {
17924
- const { text, width, direction } = item;
17925
- drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction);
17926
- currentOffsetY += width;
18057
+ else if (fVisible) {
18058
+ context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
18059
+ multilineLayout.lines.forEach(line => {
18060
+ context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
18061
+ 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, {
18062
+ width: line.width
18063
+ });
17927
18064
  });
17928
- });
18065
+ }
17929
18066
  }
17930
18067
  }
17931
18068
  else {
17932
- if (direction === 'horizontal') {
17933
- context.setTextStyle(text.attribute, textAttribute, z);
17934
- const t = text.clipedText;
17935
- let dy = 0;
17936
- if (lineHeight !== fontSize) {
17937
- if (textBaseline === 'top') {
17938
- dy = (lineHeight - fontSize) / 2;
17939
- }
17940
- else if (textBaseline === 'middle') ;
17941
- else if (textBaseline === 'bottom') {
17942
- dy = -(lineHeight - fontSize) / 2;
17943
- }
17944
- else ;
17945
- }
17946
- drawText(t, 0, dy, 0);
18069
+ let { textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline } = text.attribute;
18070
+ if (!verticalMode) {
18071
+ const t = textAlign;
18072
+ textAlign = (_b = text.getBaselineMapAlign()[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
18073
+ textBaseline = (_c = text.getAlignMapBaseline()[t]) !== null && _c !== void 0 ? _c : 'top';
18074
+ }
18075
+ text.tryUpdateAABBBounds();
18076
+ const cache = text.cache;
18077
+ const { verticalList } = cache;
18078
+ context.textAlign = 'left';
18079
+ context.textBaseline = 'top';
18080
+ const totalHeight = lineHeight * verticalList.length;
18081
+ let totalW = 0;
18082
+ verticalList.forEach(verticalData => {
18083
+ const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
18084
+ totalW = max(_w, totalW);
18085
+ });
18086
+ let offsetY = 0;
18087
+ let offsetX = 0;
18088
+ if (textBaseline === 'bottom') {
18089
+ offsetX = -totalHeight;
17947
18090
  }
17948
- else {
17949
- text.tryUpdateAABBBounds();
17950
- const cache = text.cache;
17951
- if (cache) {
17952
- context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
17953
- const { verticalList } = cache;
17954
- let offsetY = 0;
17955
- const totalW = verticalList[0].reduce((a, b) => a + (b.width || 0), 0);
17956
- let offsetX = 0;
17957
- if (textBaseline === 'bottom') {
17958
- offsetX = -lineHeight;
17959
- }
17960
- else if (textBaseline === 'middle') {
17961
- offsetX = -lineHeight / 2;
17962
- }
17963
- if (textAlign === 'center') {
17964
- offsetY -= totalW / 2;
17965
- }
17966
- else if (textAlign === 'right') {
17967
- offsetY -= totalW;
17968
- }
17969
- context.textAlign = 'left';
17970
- context.textBaseline = 'top';
17971
- verticalList[0].forEach(item => {
17972
- const { text, width, direction } = item;
17973
- drawText(text, offsetX, offsetY, direction);
17974
- offsetY += width;
17975
- });
17976
- }
18091
+ else if (textBaseline === 'middle') {
18092
+ offsetX = -totalHeight / 2;
18093
+ }
18094
+ if (textAlign === 'center') {
18095
+ offsetY -= totalW / 2;
18096
+ }
18097
+ else if (textAlign === 'right') {
18098
+ offsetY -= totalW;
17977
18099
  }
18100
+ verticalList.forEach((verticalData, i) => {
18101
+ const currentW = verticalData.reduce((a, b) => a + (b.width || 0), 0);
18102
+ const dw = totalW - currentW;
18103
+ let currentOffsetY = offsetY;
18104
+ if (textAlign === 'center') {
18105
+ currentOffsetY += dw / 2;
18106
+ }
18107
+ else if (textAlign === 'right') {
18108
+ currentOffsetY += dw;
18109
+ }
18110
+ verticalData.forEach(item => {
18111
+ const { text, width, direction } = item;
18112
+ drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction);
18113
+ currentOffsetY += width;
18114
+ });
18115
+ });
17978
18116
  }
17979
18117
  transform3dMatrixToContextMatrix && this.restoreTransformUseContext2d(text, textAttribute, z, context);
17980
18118
  this.afterRenderStep(text, context, x, y, doFill, doStroke, fVisible, sVisible, textAttribute, drawContext, fillCb, strokeCb);
@@ -17985,37 +18123,32 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17985
18123
  const computed3dMatrix = !keepDirIn3d;
17986
18124
  this._draw(text, textAttribute, computed3dMatrix, drawContext, params);
17987
18125
  }
17988
- drawUnderLine(underline, lineThrough, text, x, y, z, textAttribute, context, multiOption) {
18126
+ drawUnderLine(underline, lineThrough, text, anchorX, anchorY, offsetUnderLineY, offsetThroughLineY, z, textAttribute, context, multiOption) {
17989
18127
  if (lineThrough + underline <= 0) {
17990
18128
  return;
17991
18129
  }
17992
- const { textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline, fontSize = textAttribute.fontSize, fill = textAttribute.fill, opacity = textAttribute.opacity, underlineOffset = textAttribute.underlineOffset, underlineDash = textAttribute.underlineDash, fillOpacity = textAttribute.fillOpacity } = text.attribute;
18130
+ const { textAlign = textAttribute.textAlign, fill = textAttribute.fill, opacity = textAttribute.opacity, underlineOffset = textAttribute.underlineOffset, underlineDash = textAttribute.underlineDash, fillOpacity = textAttribute.fillOpacity } = text.attribute;
17993
18131
  const isMulti = !isNil(multiOption);
17994
18132
  const w = isMulti ? multiOption.width : text.clipedWidth;
17995
18133
  const offsetX = isMulti ? 0 : textDrawOffsetX(textAlign, w);
17996
- const offsetY = textLayoutOffsetY(isMulti ? 'alphabetic' : textBaseline, fontSize, fontSize);
17997
18134
  const attribute = { lineWidth: 0, stroke: fill, opacity, strokeOpacity: fillOpacity };
17998
- let deltaY = isMulti ? -3 : 0;
17999
18135
  if (underline) {
18000
18136
  attribute.lineWidth = underline;
18001
- context.setStrokeStyle(text, attribute, x, y, textAttribute);
18137
+ context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute);
18002
18138
  underlineDash && context.setLineDash(underlineDash);
18003
18139
  context.beginPath();
18004
- const dy = y + offsetY + fontSize + underlineOffset + deltaY;
18005
- context.moveTo(x + offsetX, dy, z);
18006
- context.lineTo(x + offsetX + w, dy, z);
18140
+ const dy = anchorY + offsetUnderLineY + underlineOffset;
18141
+ context.moveTo(anchorX + offsetX, dy, z);
18142
+ context.lineTo(anchorX + offsetX + w, dy, z);
18007
18143
  context.stroke();
18008
18144
  }
18009
- if (isMulti) {
18010
- deltaY = -1;
18011
- }
18012
18145
  if (lineThrough) {
18013
18146
  attribute.lineWidth = lineThrough;
18014
- context.setStrokeStyle(text, attribute, x, y, textAttribute);
18147
+ context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute);
18015
18148
  context.beginPath();
18016
- const dy = y + offsetY + fontSize / 2 + deltaY;
18017
- context.moveTo(x + offsetX, dy, z);
18018
- context.lineTo(x + offsetX + w, dy, z);
18149
+ const dy = anchorY + offsetThroughLineY;
18150
+ context.moveTo(anchorX + offsetX, dy, z);
18151
+ context.lineTo(anchorX + offsetX + w, dy, z);
18019
18152
  context.stroke();
18020
18153
  }
18021
18154
  }
@@ -18455,18 +18588,16 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
18455
18588
  }
18456
18589
  draw(image, renderService, drawContext) {
18457
18590
  const { image: url } = image.attribute;
18458
- if (!image.isGifImage) {
18459
- if (!url || !image.resources) {
18460
- return;
18461
- }
18462
- const res = image.resources.get(url);
18463
- if (res.state === 'loading' && isString(url)) {
18464
- ResourceLoader.improveImageLoading(url);
18465
- return;
18466
- }
18467
- else if (res.state !== 'success') {
18468
- return;
18469
- }
18591
+ if (!url || !image.resources) {
18592
+ return;
18593
+ }
18594
+ const res = image.resources.get(url);
18595
+ if (res.state === 'loading' && isString(url)) {
18596
+ ResourceLoader.improveImageLoading(url);
18597
+ return;
18598
+ }
18599
+ else if (res.state !== 'success') {
18600
+ return;
18470
18601
  }
18471
18602
  const { context } = renderService.drawParams;
18472
18603
  if (!context) {
@@ -19046,66 +19177,39 @@ class CanvasTextLayout {
19046
19177
  }
19047
19178
  return bbox;
19048
19179
  }
19049
- GetLayout(str, width, height, textAlign, textBaseline, lineHeight, suffix, wordBreak, suffixPosition) {
19050
- const linesLayout = [];
19051
- const bboxWH = [width, height];
19052
- const bboxOffset = [0, 0];
19053
- while (str.length > 0) {
19054
- const { str: clipText } = this.textMeasure.clipTextWithSuffix(str, this.textOptions, width, suffix, wordBreak, suffixPosition);
19055
- linesLayout.push({
19056
- str: clipText,
19057
- width: this.textMeasure.measureTextWidth(clipText, this.textOptions)
19058
- });
19059
- str = str.substring(clipText.length);
19060
- }
19061
- if (textAlign === 'left' || textAlign === 'start') ;
19062
- else if (textAlign === 'center') {
19063
- bboxOffset[0] = bboxWH[0] / -2;
19064
- }
19065
- else if (textAlign === 'right' || textAlign === 'end') {
19066
- bboxOffset[0] = -bboxWH[0];
19067
- }
19068
- if (textBaseline === 'top') ;
19069
- else if (textBaseline === 'middle') {
19070
- bboxOffset[1] = bboxWH[1] / -2;
19071
- }
19072
- else if (textBaseline === 'bottom') {
19073
- bboxOffset[1] = -bboxWH[1];
19074
- }
19075
- const bbox = {
19076
- xOffset: bboxOffset[0],
19077
- yOffset: bboxOffset[1],
19078
- width: bboxWH[0],
19079
- height: bboxWH[1]
19080
- };
19081
- return this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
19082
- }
19083
- GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = '', wordBreak, lineWidth, suffixPosition = 'end') {
19180
+ GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = '', wordBreak, params) {
19181
+ const { lineWidth, suffixPosition = 'end', measureMode = MeasureModeEnum.actualBounding } = params !== null && params !== void 0 ? params : {};
19084
19182
  lines = lines.map(l => l.toString());
19085
19183
  const linesLayout = [];
19086
19184
  const bboxWH = [0, 0];
19087
19185
  if (typeof lineWidth === 'number' && lineWidth !== Infinity) {
19088
19186
  let width;
19089
19187
  for (let i = 0, len = lines.length; i < len; i++) {
19090
- width = Math.min(this.textMeasure.measureTextWidth(lines[i], this.textOptions), lineWidth);
19188
+ const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
19189
+ width = Math.min(metrics.width, lineWidth);
19091
19190
  linesLayout.push({
19092
- str: this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
19093
- width
19191
+ str: metrics.width <= lineWidth
19192
+ ? lines[i].toString()
19193
+ : this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
19194
+ width,
19195
+ ascent: metrics.ascent,
19196
+ descent: metrics.descent
19094
19197
  });
19095
19198
  }
19096
19199
  bboxWH[0] = lineWidth;
19097
19200
  }
19098
19201
  else {
19099
- lineWidth = 0;
19202
+ let _lineWidth = 0;
19100
19203
  let width;
19101
19204
  let text;
19102
19205
  for (let i = 0, len = lines.length; i < len; i++) {
19103
19206
  text = lines[i];
19104
- width = this.textMeasure.measureTextWidth(text, this.textOptions);
19105
- lineWidth = Math.max(lineWidth, width);
19106
- linesLayout.push({ str: text, width });
19207
+ const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
19208
+ width = metrics.width;
19209
+ _lineWidth = Math.max(_lineWidth, width);
19210
+ linesLayout.push({ str: text, width, ascent: metrics.ascent, descent: metrics.descent });
19107
19211
  }
19108
- bboxWH[0] = lineWidth;
19212
+ bboxWH[0] = _lineWidth;
19109
19213
  }
19110
19214
  bboxWH[1] = linesLayout.length * lineHeight;
19111
19215
  bboxWH[0] = linesLayout.reduce((a, b) => Math.max(a, b.width), 0);
@@ -19152,7 +19256,7 @@ class CanvasTextLayout {
19152
19256
  else if (textAlign === 'right' || textAlign === 'end') {
19153
19257
  line.leftOffset = bbox.width - line.width;
19154
19258
  }
19155
- line.topOffset = (lineHeight - this.textOptions.fontSize) / 2 + this.textOptions.fontSize * 0.79 + origin[1];
19259
+ line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1];
19156
19260
  origin[1] += lineHeight;
19157
19261
  return line;
19158
19262
  }
@@ -19161,6 +19265,7 @@ class CanvasTextLayout {
19161
19265
  const TEXT_UPDATE_TAG_KEY = [
19162
19266
  'text',
19163
19267
  'maxLineWidth',
19268
+ 'maxWidth',
19164
19269
  'textAlign',
19165
19270
  'textBaseline',
19166
19271
  'heightLimit',
@@ -19188,20 +19293,14 @@ class Text extends Graphic {
19188
19293
  var _a;
19189
19294
  const attribute = this.attribute;
19190
19295
  const textTheme = this.getGraphicTheme();
19191
- if (!this.isSimplify()) {
19192
- return undefined;
19193
- }
19194
- const { maxLineWidth = textTheme.maxLineWidth } = attribute;
19195
- if (!Number.isFinite(maxLineWidth)) {
19296
+ const maxWidth = this.getMaxWidth(textTheme);
19297
+ if (!Number.isFinite(maxWidth)) {
19196
19298
  return ((_a = attribute.text) !== null && _a !== void 0 ? _a : textTheme.text).toString();
19197
19299
  }
19198
19300
  this.tryUpdateAABBBounds();
19199
19301
  return this.cache.clipedText;
19200
19302
  }
19201
19303
  get clipedWidth() {
19202
- if (!this.isSimplify()) {
19203
- return undefined;
19204
- }
19205
19304
  this.tryUpdateAABBBounds();
19206
19305
  return this.cache.clipedWidth;
19207
19306
  }
@@ -19209,10 +19308,11 @@ class Text extends Graphic {
19209
19308
  var _a, _b;
19210
19309
  const textTheme = this.getGraphicTheme();
19211
19310
  const attribute = this.attribute;
19212
- const { maxLineWidth = textTheme.maxLineWidth, text, whiteSpace = textTheme.whiteSpace } = attribute;
19213
- if (!Number.isFinite(maxLineWidth)) {
19311
+ const maxWidth = this.getMaxWidth(textTheme);
19312
+ if (!Number.isFinite(maxWidth)) {
19214
19313
  return false;
19215
19314
  }
19315
+ const { text } = this.attribute;
19216
19316
  this.tryUpdateAABBBounds();
19217
19317
  if ((_b = (_a = this.cache) === null || _a === void 0 ? void 0 : _a.layoutData) === null || _b === void 0 ? void 0 : _b.lines) {
19218
19318
  let mergedText = '';
@@ -19231,15 +19331,9 @@ class Text extends Graphic {
19231
19331
  return this.clipedText !== attribute.text.toString();
19232
19332
  }
19233
19333
  get multilineLayout() {
19234
- if (!this.isMultiLine) {
19235
- return undefined;
19236
- }
19237
19334
  this.tryUpdateAABBBounds();
19238
19335
  return this.cache.layoutData;
19239
19336
  }
19240
- isSimplify() {
19241
- return !this.isMultiLine && this.attribute.direction !== 'vertical';
19242
- }
19243
19337
  get isMultiLine() {
19244
19338
  return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';
19245
19339
  }
@@ -19307,13 +19401,73 @@ class Text extends Graphic {
19307
19401
  transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix);
19308
19402
  return aabbBounds;
19309
19403
  }
19404
+ updateSingallineAABBBounds(text) {
19405
+ this.updateMultilineAABBBounds([text]);
19406
+ const layoutData = this.cache.layoutData;
19407
+ if (layoutData) {
19408
+ const line = layoutData.lines[0];
19409
+ this.cache.clipedText = line.str;
19410
+ this.cache.clipedWidth = line.width;
19411
+ }
19412
+ return this._AABBBounds;
19413
+ }
19414
+ updateMultilineAABBBounds(text) {
19415
+ const textTheme = this.getGraphicTheme();
19416
+ const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;
19417
+ const b = direction === 'horizontal'
19418
+ ? this.updateHorizontalMultilineAABBBounds(text)
19419
+ : this.updateVerticalMultilineAABBBounds(text);
19420
+ if (direction === 'horizontal') {
19421
+ if (underlineOffset) {
19422
+ this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);
19423
+ }
19424
+ }
19425
+ return b;
19426
+ }
19427
+ guessLineHeightBuf(fontSize) {
19428
+ return fontSize ? fontSize * 0.1 : 0;
19429
+ }
19430
+ updateHorizontalMultilineAABBBounds(text) {
19431
+ var _a;
19432
+ const textTheme = this.getGraphicTheme();
19433
+ const attribute = this.attribute;
19434
+ const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, wrap = textTheme.wrap, measureMode = textTheme.measureMode, lineWidth = textTheme.lineWidth, whiteSpace = textTheme.whiteSpace, suffixPosition = textTheme.suffixPosition, ignoreBuf = textTheme.ignoreBuf } = attribute;
19435
+ const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);
19436
+ const lineHeight = this.getLineHeight(attribute, textTheme) + buf;
19437
+ if (whiteSpace === 'normal' || wrap) {
19438
+ return this.updateWrapAABBBounds(text);
19439
+ }
19440
+ if (!this.shouldUpdateShape() && ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.layoutData)) {
19441
+ const bbox = this.cache.layoutData.bbox;
19442
+ this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
19443
+ if (stroke) {
19444
+ this._AABBBounds.expand(lineWidth / 2);
19445
+ }
19446
+ return this._AABBBounds;
19447
+ }
19448
+ const textMeasure = application.graphicUtil.textMeasure;
19449
+ const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily, lineHeight }, textMeasure);
19450
+ const layoutData = layoutObj.GetLayoutByLines(text, textAlign, textBaseline, lineHeight, ellipsis === true ? textTheme.ellipsis : ellipsis || undefined, false, {
19451
+ lineWidth: maxLineWidth,
19452
+ suffixPosition,
19453
+ measureMode
19454
+ });
19455
+ const { bbox } = layoutData;
19456
+ this.cache.layoutData = layoutData;
19457
+ this.clearUpdateShapeTag();
19458
+ this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
19459
+ if (stroke) {
19460
+ this._AABBBounds.expand(lineWidth / 2);
19461
+ }
19462
+ return this._AABBBounds;
19463
+ }
19310
19464
  updateWrapAABBBounds(text) {
19311
- var _a, _b, _c, _d;
19465
+ var _a, _b, _c;
19312
19466
  const textTheme = this.getGraphicTheme();
19313
- const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, wordBreak = textTheme.wordBreak, fontWeight = textTheme.fontWeight, ignoreBuf = textTheme.ignoreBuf, suffixPosition = textTheme.suffixPosition, heightLimit = 0, lineClamp } = this.attribute;
19314
- const lineHeight = (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (this.attribute.fontSize || textTheme.fontSize);
19315
- const buf = ignoreBuf ? 0 : 2;
19316
- if (!this.shouldUpdateShape() && ((_b = this.cache) === null || _b === void 0 ? void 0 : _b.layoutData)) {
19467
+ const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, wordBreak = textTheme.wordBreak, fontWeight = textTheme.fontWeight, ignoreBuf = textTheme.ignoreBuf, measureMode = textTheme.measureMode, suffixPosition = textTheme.suffixPosition, heightLimit = 0, lineClamp } = this.attribute;
19468
+ const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);
19469
+ const lineHeight = this.getLineHeight(this.attribute, textTheme) + buf;
19470
+ if (!this.shouldUpdateShape() && ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.layoutData)) {
19317
19471
  const bbox = this.cache.layoutData.bbox;
19318
19472
  this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
19319
19473
  if (stroke) {
@@ -19322,7 +19476,8 @@ class Text extends Graphic {
19322
19476
  return this._AABBBounds;
19323
19477
  }
19324
19478
  const textMeasure = application.graphicUtil.textMeasure;
19325
- const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure);
19479
+ const textOptions = { fontSize, fontWeight, fontFamily, lineHeight };
19480
+ const layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure);
19326
19481
  const lines = isArray(text) ? text.map(l => l.toString()) : [text.toString()];
19327
19482
  const linesLayout = [];
19328
19483
  const bboxWH = [0, 0];
@@ -19339,19 +19494,22 @@ class Text extends Graphic {
19339
19494
  const str = lines[i];
19340
19495
  let needCut = true;
19341
19496
  if (i === lineCountLimit - 1) {
19342
- const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition, i !== lines.length - 1);
19497
+ const clip = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, false, suffixPosition, i !== lines.length - 1);
19498
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
19343
19499
  linesLayout.push({
19344
19500
  str: clip.str,
19345
- width: clip.width
19501
+ width: clip.width,
19502
+ ascent: matrics.ascent,
19503
+ descent: matrics.descent
19346
19504
  });
19347
19505
  break;
19348
19506
  }
19349
- const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, wordBreak !== 'break-all', wordBreak === 'keep-all');
19507
+ const clip = textMeasure.clipText(str, textOptions, maxLineWidth, wordBreak !== 'break-all', wordBreak === 'keep-all');
19350
19508
  if ((str !== '' && clip.str === '') || clip.wordBreaked) {
19351
19509
  if (ellipsis) {
19352
- const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19353
- clip.str = (_c = clipEllipsis.str) !== null && _c !== void 0 ? _c : '';
19354
- clip.width = (_d = clipEllipsis.width) !== null && _d !== void 0 ? _d : 0;
19510
+ const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19511
+ clip.str = (_b = clipEllipsis.str) !== null && _b !== void 0 ? _b : '';
19512
+ clip.width = (_c = clipEllipsis.width) !== null && _c !== void 0 ? _c : 0;
19355
19513
  }
19356
19514
  else {
19357
19515
  clip.str = '';
@@ -19359,9 +19517,12 @@ class Text extends Graphic {
19359
19517
  }
19360
19518
  needCut = false;
19361
19519
  }
19520
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
19362
19521
  linesLayout.push({
19363
19522
  str: clip.str,
19364
- width: clip.width
19523
+ width: clip.width,
19524
+ ascent: matrics.ascent,
19525
+ descent: matrics.descent
19365
19526
  });
19366
19527
  let cutLength = clip.str.length;
19367
19528
  if (clip.wordBreaked && !(str !== '' && clip.str === '')) {
@@ -19370,10 +19531,7 @@ class Text extends Graphic {
19370
19531
  }
19371
19532
  if (clip.str.length === str.length) ;
19372
19533
  else if (needCut) {
19373
- let newStr = str.substring(cutLength);
19374
- if (wordBreak === 'keep-all') {
19375
- newStr = newStr.replace(/^\s+/g, '');
19376
- }
19534
+ const newStr = str.substring(cutLength);
19377
19535
  lines.splice(i + 1, 0, newStr);
19378
19536
  }
19379
19537
  }
@@ -19390,22 +19548,26 @@ class Text extends Graphic {
19390
19548
  let text;
19391
19549
  for (let i = 0, len = lines.length; i < len; i++) {
19392
19550
  if (i === lineCountLimit - 1) {
19393
- const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19551
+ const clip = textMeasure.clipTextWithSuffix(lines[i], textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19552
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
19394
19553
  linesLayout.push({
19395
19554
  str: clip.str,
19396
- width: clip.width
19555
+ width: clip.width,
19556
+ ascent: matrics.ascent,
19557
+ descent: matrics.descent
19397
19558
  });
19398
19559
  lineWidth = Math.max(lineWidth, clip.width);
19399
19560
  break;
19400
19561
  }
19401
19562
  text = lines[i];
19402
- width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, wordBreak === 'break-word');
19563
+ width = textMeasure.measureTextWidth(text, textOptions);
19403
19564
  lineWidth = Math.max(lineWidth, width);
19404
- linesLayout.push({ str: text, width });
19565
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);
19566
+ linesLayout.push({ str: text, width, ascent: matrics.ascent, descent: matrics.descent });
19405
19567
  }
19406
19568
  bboxWH[0] = lineWidth;
19407
19569
  }
19408
- bboxWH[1] = linesLayout.length * (lineHeight + buf);
19570
+ bboxWH[1] = linesLayout.length * lineHeight;
19409
19571
  const bbox = {
19410
19572
  xOffset: 0,
19411
19573
  yOffset: 0,
@@ -19422,212 +19584,19 @@ class Text extends Graphic {
19422
19584
  }
19423
19585
  return this._AABBBounds;
19424
19586
  }
19425
- updateSingallineAABBBounds(text) {
19426
- const textTheme = this.getGraphicTheme();
19427
- const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;
19428
- const b = direction === 'horizontal'
19429
- ? this.updateHorizontalSinglelineAABBBounds(text)
19430
- : this.updateVerticalSinglelineAABBBounds(text);
19431
- if (direction === 'horizontal') {
19432
- if (underlineOffset) {
19433
- this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);
19434
- }
19435
- }
19436
- return b;
19437
- }
19438
- updateMultilineAABBBounds(text) {
19439
- const textTheme = this.getGraphicTheme();
19440
- const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;
19441
- const b = direction === 'horizontal'
19442
- ? this.updateHorizontalMultilineAABBBounds(text)
19443
- : this.updateVerticalMultilineAABBBounds(text);
19444
- if (direction === 'horizontal') {
19445
- if (underlineOffset) {
19446
- this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);
19447
- }
19448
- }
19449
- return b;
19450
- }
19451
- updateHorizontalSinglelineAABBBounds(text) {
19452
- var _a, _b;
19453
- const textTheme = this.getGraphicTheme();
19454
- const { wrap = textTheme.wrap } = this.attribute;
19455
- if (wrap) {
19456
- return this.updateWrapAABBBounds([text]);
19457
- }
19458
- const textMeasure = application.graphicUtil.textMeasure;
19459
- let width;
19460
- let str;
19461
- const attribute = this.attribute;
19462
- const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontFamily = textTheme.fontFamily, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, ignoreBuf = textTheme.ignoreBuf, whiteSpace = textTheme.whiteSpace, suffixPosition = textTheme.suffixPosition } = attribute;
19463
- if (whiteSpace === 'normal') {
19464
- return this.updateWrapAABBBounds(text);
19465
- }
19466
- const buf = ignoreBuf ? 0 : Math.max(2, fontSize * 0.075);
19467
- const textFontSize = attribute.fontSize || textTheme.fontSize;
19468
- const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) !== null && _a !== void 0 ? _a : textFontSize + buf;
19469
- if (!this.shouldUpdateShape() && this.cache) {
19470
- width = (_b = this.cache.clipedWidth) !== null && _b !== void 0 ? _b : 0;
19471
- const dx = textDrawOffsetX(textAlign, width);
19472
- const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
19473
- this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight);
19474
- if (stroke) {
19475
- this._AABBBounds.expand(lineWidth / 2);
19476
- }
19477
- return this._AABBBounds;
19478
- }
19479
- if (Number.isFinite(maxLineWidth)) {
19480
- if (ellipsis) {
19481
- const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis);
19482
- const data = textMeasure.clipTextWithSuffix(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false, suffixPosition);
19483
- str = data.str;
19484
- width = data.width;
19485
- }
19486
- else {
19487
- const data = textMeasure.clipText(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, false);
19488
- str = data.str;
19489
- width = data.width;
19490
- }
19491
- this.cache.clipedText = str;
19492
- this.cache.clipedWidth = width;
19493
- }
19494
- else {
19495
- width = textMeasure.measureTextWidth(text.toString(), { fontSize, fontWeight, fontFamily });
19496
- this.cache.clipedText = text.toString();
19497
- this.cache.clipedWidth = width;
19498
- }
19499
- this.clearUpdateShapeTag();
19500
- const dx = textDrawOffsetX(textAlign, width);
19501
- let lh = lineHeight;
19502
- if (application.global && application.global.isSafari()) {
19503
- lh += fontSize * 0.2;
19504
- }
19505
- const dy = textLayoutOffsetY(textBaseline, lh, fontSize, buf);
19506
- this._AABBBounds.set(dx, dy, dx + width, dy + lh);
19507
- if (stroke) {
19508
- this._AABBBounds.expand(lineWidth / 2);
19509
- }
19510
- return this._AABBBounds;
19511
- }
19512
- getBaselineMapAlign() {
19513
- return Text.baselineMapAlign;
19514
- }
19515
- getAlignMapBaseline() {
19516
- return Text.alignMapBaseline;
19517
- }
19518
- updateVerticalSinglelineAABBBounds(text) {
19519
- var _a, _b, _c;
19520
- const textTheme = this.getGraphicTheme();
19521
- const textMeasure = application.graphicUtil.textMeasure;
19522
- let width;
19523
- const attribute = this.attribute;
19524
- const { ignoreBuf = textTheme.ignoreBuf } = attribute;
19525
- const buf = ignoreBuf ? 0 : 2;
19526
- const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, fontFamily = textTheme.fontFamily, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, verticalMode = textTheme.verticalMode, suffixPosition = textTheme.suffixPosition } = attribute;
19527
- const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
19528
- let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;
19529
- if (!verticalMode) {
19530
- const t = textAlign;
19531
- textAlign = (_b = Text.baselineMapAlign[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
19532
- textBaseline = (_c = Text.alignMapBaseline[t]) !== null && _c !== void 0 ? _c : 'top';
19533
- }
19534
- if (!this.shouldUpdateShape() && this.cache) {
19535
- width = this.cache.clipedWidth;
19536
- const dx = textDrawOffsetX(textAlign, width);
19537
- const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
19538
- this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);
19539
- if (stroke) {
19540
- this._AABBBounds.expand(lineWidth / 2);
19541
- }
19542
- return this._AABBBounds;
19543
- }
19544
- let verticalList = [
19545
- verticalLayout(text.toString())
19546
- ];
19547
- if (Number.isFinite(maxLineWidth)) {
19548
- if (ellipsis) {
19549
- const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis);
19550
- const data = textMeasure.clipTextWithSuffixVertical(verticalList[0], { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false, suffixPosition);
19551
- verticalList = [data.verticalList];
19552
- width = data.width;
19553
- }
19554
- else {
19555
- const data = textMeasure.clipTextVertical(verticalList[0], { fontSize, fontWeight, fontFamily }, maxLineWidth, false);
19556
- verticalList = [data.verticalList];
19557
- width = data.width;
19558
- }
19559
- this.cache.verticalList = verticalList;
19560
- this.cache.clipedWidth = width;
19561
- }
19562
- else {
19563
- width = 0;
19564
- verticalList[0].forEach(t => {
19565
- const w = t.direction === TextDirection.HORIZONTAL
19566
- ? fontSize
19567
- : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });
19568
- width += w;
19569
- t.width = w;
19570
- });
19571
- this.cache.verticalList = verticalList;
19572
- this.cache.clipedWidth = width;
19573
- }
19574
- this.clearUpdateShapeTag();
19575
- const dx = textDrawOffsetX(textAlign, width);
19576
- const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
19577
- this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);
19578
- if (stroke) {
19579
- this._AABBBounds.expand(lineWidth / 2);
19580
- }
19581
- return this._AABBBounds;
19582
- }
19583
- updateHorizontalMultilineAABBBounds(text) {
19584
- var _a, _b;
19585
- const textTheme = this.getGraphicTheme();
19586
- const { wrap = textTheme.wrap } = this.attribute;
19587
- if (wrap) {
19588
- return this.updateWrapAABBBounds(text);
19589
- }
19590
- const attribute = this.attribute;
19591
- const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, whiteSpace = textTheme.whiteSpace, suffixPosition = textTheme.suffixPosition } = attribute;
19592
- const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize);
19593
- if (whiteSpace === 'normal') {
19594
- return this.updateWrapAABBBounds(text);
19595
- }
19596
- if (!this.shouldUpdateShape() && ((_b = this.cache) === null || _b === void 0 ? void 0 : _b.layoutData)) {
19597
- const bbox = this.cache.layoutData.bbox;
19598
- this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
19599
- if (stroke) {
19600
- this._AABBBounds.expand(lineWidth / 2);
19601
- }
19602
- return this._AABBBounds;
19603
- }
19604
- const textMeasure = application.graphicUtil.textMeasure;
19605
- const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure);
19606
- const layoutData = layoutObj.GetLayoutByLines(text, textAlign, textBaseline, lineHeight, ellipsis === true ? textTheme.ellipsis : ellipsis || undefined, false, maxLineWidth, suffixPosition);
19607
- const { bbox } = layoutData;
19608
- this.cache.layoutData = layoutData;
19609
- this.clearUpdateShapeTag();
19610
- this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
19611
- if (stroke) {
19612
- this._AABBBounds.expand(lineWidth / 2);
19613
- }
19614
- return this._AABBBounds;
19615
- }
19616
19587
  updateVerticalMultilineAABBBounds(text) {
19617
- var _a, _b, _c;
19588
+ var _a, _b;
19618
19589
  const textTheme = this.getGraphicTheme();
19619
19590
  const textMeasure = application.graphicUtil.textMeasure;
19620
19591
  let width;
19621
19592
  const attribute = this.attribute;
19622
- const { ignoreBuf = textTheme.ignoreBuf } = attribute;
19623
- const buf = ignoreBuf ? 0 : 2;
19624
19593
  const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, fontFamily = textTheme.fontFamily, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, verticalMode = textTheme.verticalMode, suffixPosition = textTheme.suffixPosition } = attribute;
19625
- const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
19594
+ const lineHeight = this.getLineHeight(attribute, textTheme);
19626
19595
  let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;
19627
19596
  if (!verticalMode) {
19628
19597
  const t = textAlign;
19629
- textAlign = (_b = Text.baselineMapAlign[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
19630
- textBaseline = (_c = Text.alignMapBaseline[t]) !== null && _c !== void 0 ? _c : 'top';
19598
+ textAlign = (_a = Text.baselineMapAlign[textBaseline]) !== null && _a !== void 0 ? _a : 'left';
19599
+ textBaseline = (_b = Text.alignMapBaseline[t]) !== null && _b !== void 0 ? _b : 'top';
19631
19600
  }
19632
19601
  width = 0;
19633
19602
  if (!this.shouldUpdateShape() && this.cache) {
@@ -19687,6 +19656,15 @@ class Text extends Graphic {
19687
19656
  }
19688
19657
  return this._AABBBounds;
19689
19658
  }
19659
+ getMaxWidth(theme) {
19660
+ var _a, _b;
19661
+ const attribute = this.attribute;
19662
+ return (_b = (_a = attribute.maxLineWidth) !== null && _a !== void 0 ? _a : attribute.maxWidth) !== null && _b !== void 0 ? _b : theme.maxWidth;
19663
+ }
19664
+ getLineHeight(attribute, textTheme) {
19665
+ var _a;
19666
+ return ((_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize));
19667
+ }
19690
19668
  needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
19691
19669
  return super.needUpdateTags(keys, k);
19692
19670
  }
@@ -19699,6 +19677,12 @@ class Text extends Graphic {
19699
19677
  getNoWorkAnimateAttr() {
19700
19678
  return Text.NOWORK_ANIMATE_ATTR;
19701
19679
  }
19680
+ getBaselineMapAlign() {
19681
+ return Text.baselineMapAlign;
19682
+ }
19683
+ getAlignMapBaseline() {
19684
+ return Text.alignMapBaseline;
19685
+ }
19702
19686
  }
19703
19687
  Text.NOWORK_ANIMATE_ATTR = Object.assign({ ellipsis: 1, wordBreak: 1, direction: 1, textAlign: 1, textBaseline: 1, fontFamily: 1, fontWeight: 1 }, NOWORK_ANIMATE_ATTR);
19704
19688
  Text.baselineMapAlign = {
@@ -19762,7 +19746,9 @@ class WrapText extends Text {
19762
19746
  const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19763
19747
  linesLayout.push({
19764
19748
  str: clip.str,
19765
- width: clip.width
19749
+ width: clip.width,
19750
+ ascent: 0,
19751
+ descent: 0
19766
19752
  });
19767
19753
  break;
19768
19754
  }
@@ -19781,7 +19767,9 @@ class WrapText extends Text {
19781
19767
  }
19782
19768
  linesLayout.push({
19783
19769
  str: clip.str,
19784
- width: clip.width
19770
+ width: clip.width,
19771
+ ascent: 0,
19772
+ descent: 0
19785
19773
  });
19786
19774
  if (clip.str.length === str.length) ;
19787
19775
  else if (needCut) {
@@ -19805,7 +19793,9 @@ class WrapText extends Text {
19805
19793
  const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19806
19794
  linesLayout.push({
19807
19795
  str: clip.str,
19808
- width: clip.width
19796
+ width: clip.width,
19797
+ ascent: 0,
19798
+ descent: 0
19809
19799
  });
19810
19800
  lineWidth = Math.max(lineWidth, clip.width);
19811
19801
  break;
@@ -19813,7 +19803,7 @@ class WrapText extends Text {
19813
19803
  text = lines[i];
19814
19804
  width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, wordBreak === 'break-word');
19815
19805
  lineWidth = Math.max(lineWidth, width);
19816
- linesLayout.push({ str: text, width });
19806
+ linesLayout.push({ str: text, width, ascent: 0, descent: 0 });
19817
19807
  }
19818
19808
  bboxWH[0] = lineWidth;
19819
19809
  }
@@ -19876,6 +19866,9 @@ class BaseSymbol {
19876
19866
  bounds.y2 = size[1] / 2;
19877
19867
  }
19878
19868
  }
19869
+ parseSize(size) {
19870
+ return isNumber(size) ? size : Math.min(size[0], size[1]);
19871
+ }
19879
19872
  }
19880
19873
 
19881
19874
  function circle(ctx, r, x, y, z) {
@@ -19894,15 +19887,15 @@ class CircleSymbol extends BaseSymbol {
19894
19887
  this.pathStr = 'M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0';
19895
19888
  }
19896
19889
  draw(ctx, size, x, y, z) {
19897
- const r = size / 2;
19890
+ const r = this.parseSize(size) / 2;
19898
19891
  return circle(ctx, r, x, y, z);
19899
19892
  }
19900
19893
  drawOffset(ctx, size, x, y, offset, z) {
19901
- const r = size / 2 + offset;
19894
+ const r = this.parseSize(size) / 2 + offset;
19902
19895
  return circle(ctx, r, x, y, z);
19903
19896
  }
19904
19897
  drawToSvgPath(size, x, y, z) {
19905
- const r = size / 2;
19898
+ const r = this.parseSize(size) / 2;
19906
19899
  return `M ${x - r}, ${y} a ${r},${r} 0 1,0 ${r * 2},0 a ${r},${r} 0 1,0 -${r * 2},0`;
19907
19900
  }
19908
19901
  }
@@ -19947,11 +19940,11 @@ class CrossSymbol extends BaseSymbol {
19947
19940
  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';
19948
19941
  }
19949
19942
  draw(ctx, size, x, y, z) {
19950
- const r = size / 6;
19943
+ const r = this.parseSize(size) / 6;
19951
19944
  return cross(ctx, r, x, y, z);
19952
19945
  }
19953
19946
  drawOffset(ctx, size, x, y, offset, z) {
19954
- const r = size / 6;
19947
+ const r = this.parseSize(size) / 6;
19955
19948
  return crossOffset(ctx, r, x, y, offset, z);
19956
19949
  }
19957
19950
  }
@@ -19972,15 +19965,15 @@ class DiamondSymbol extends BaseSymbol {
19972
19965
  this.pathStr = 'M-0.5,0L0,-0.5L0.5,0L0,0.5Z';
19973
19966
  }
19974
19967
  draw(ctx, size, x, y, z) {
19975
- const r = size / 2;
19968
+ const r = this.parseSize(size) / 2;
19976
19969
  return diamond(ctx, r, x, y, z);
19977
19970
  }
19978
19971
  drawFitDir(ctx, size, x, y, z) {
19979
- const r = size / 2;
19972
+ const r = this.parseSize(size) / 2;
19980
19973
  return diamond(ctx, r, x, y, z);
19981
19974
  }
19982
19975
  drawOffset(ctx, size, x, y, offset, z) {
19983
- const r = size / 2 + offset;
19976
+ const r = this.parseSize(size) / 2 + offset;
19984
19977
  return diamond(ctx, r, x, y, z);
19985
19978
  }
19986
19979
  }
@@ -19998,11 +19991,11 @@ class SquareSymbol extends BaseSymbol {
19998
19991
  this.pathStr = 'M-0.5,-0.5h1v1h-1Z';
19999
19992
  }
20000
19993
  draw(ctx, size, x, y) {
20001
- const r = size / 2;
19994
+ const r = this.parseSize(size) / 2;
20002
19995
  return square(ctx, r, x, y);
20003
19996
  }
20004
19997
  drawOffset(ctx, size, x, y, offset) {
20005
- const r = size / 2 + offset;
19998
+ const r = this.parseSize(size) / 2 + offset;
20006
19999
  return square(ctx, r, x, y);
20007
20000
  }
20008
20001
  }
@@ -20022,11 +20015,11 @@ class TriangleUpSymbol extends BaseSymbol {
20022
20015
  this.pathStr = 'M0.5,0.5 L-0.5,0.5 L0,-0.5 Z';
20023
20016
  }
20024
20017
  draw(ctx, size, x, y) {
20025
- const r = size / 2;
20018
+ const r = this.parseSize(size) / 2;
20026
20019
  return trianglUpOffset(ctx, r, x, y);
20027
20020
  }
20028
20021
  drawOffset(ctx, size, x, y, offset) {
20029
- const r = size / 2;
20022
+ const r = this.parseSize(size) / 2;
20030
20023
  return trianglUpOffset(ctx, r, x, y, offset);
20031
20024
  }
20032
20025
  }
@@ -20065,11 +20058,11 @@ class StarSymbol extends BaseSymbol {
20065
20058
  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';
20066
20059
  }
20067
20060
  draw(ctx, size, transX, transY) {
20068
- const r = size / 2;
20061
+ const r = this.parseSize(size) / 2;
20069
20062
  return star(ctx, r, transX, transY);
20070
20063
  }
20071
20064
  drawOffset(ctx, size, transX, transY, offset) {
20072
- const r = size / 2 + offset;
20065
+ const r = this.parseSize(size) / 2 + offset;
20073
20066
  return star(ctx, r, transX, transY);
20074
20067
  }
20075
20068
  }
@@ -20098,11 +20091,11 @@ class ArrowSymbol extends BaseSymbol {
20098
20091
  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';
20099
20092
  }
20100
20093
  draw(ctx, size, transX, transY) {
20101
- const r = size / 2;
20094
+ const r = this.parseSize(size) / 2;
20102
20095
  return arrow(ctx, r, transX, transY);
20103
20096
  }
20104
20097
  drawOffset(ctx, size, transX, transY, offset) {
20105
- const r = size / 2 + offset;
20098
+ const r = this.parseSize(size) / 2 + offset;
20106
20099
  return arrow(ctx, r, transX, transY);
20107
20100
  }
20108
20101
  }
@@ -20123,11 +20116,11 @@ class WedgeSymbol extends BaseSymbol {
20123
20116
  this.pathStr = 'M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z';
20124
20117
  }
20125
20118
  draw(ctx, size, transX, transY) {
20126
- const r = size / 2;
20119
+ const r = this.parseSize(size) / 2;
20127
20120
  return wedge(ctx, r, transX, transY);
20128
20121
  }
20129
20122
  drawOffset(ctx, size, transX, transY, offset) {
20130
- const r = size / 2 + offset;
20123
+ const r = this.parseSize(size) / 2 + offset;
20131
20124
  return wedge(ctx, r, transX, transY);
20132
20125
  }
20133
20126
  }
@@ -20145,11 +20138,11 @@ class StrokeSymbol extends BaseSymbol {
20145
20138
  this.pathStr = '';
20146
20139
  }
20147
20140
  draw(ctx, size, transX, transY) {
20148
- const r = size / 2;
20141
+ const r = this.parseSize(size) / 2;
20149
20142
  return stroke(ctx, r, transX, transY);
20150
20143
  }
20151
20144
  drawOffset(ctx, size, transX, transY, offset) {
20152
- const r = size / 2 + offset;
20145
+ const r = this.parseSize(size) / 2 + offset;
20153
20146
  return stroke(ctx, r, transX, transY);
20154
20147
  }
20155
20148
  }
@@ -20184,11 +20177,11 @@ class WyeSymbol extends BaseSymbol {
20184
20177
  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';
20185
20178
  }
20186
20179
  draw(ctx, size, transX, transY) {
20187
- const r = size / 2;
20180
+ const r = this.parseSize(size) / 2;
20188
20181
  return wye(ctx, r, transX, transY);
20189
20182
  }
20190
20183
  drawOffset(ctx, size, transX, transY, offset) {
20191
- const r = size / 2 + offset;
20184
+ const r = this.parseSize(size) / 2 + offset;
20192
20185
  return wye(ctx, r, transX, transY);
20193
20186
  }
20194
20187
  }
@@ -20208,11 +20201,11 @@ class TriangleLeftSymbol extends BaseSymbol {
20208
20201
  this.pathStr = 'M-0.5,0 L0.5,0.5 L0.5,-0.5 Z';
20209
20202
  }
20210
20203
  draw(ctx, size, x, y) {
20211
- const r = size / 2;
20204
+ const r = this.parseSize(size) / 2;
20212
20205
  return trianglLeftOffset(ctx, r, x, y, 0);
20213
20206
  }
20214
20207
  drawOffset(ctx, size, x, y, offset) {
20215
- const r = size / 2;
20208
+ const r = this.parseSize(size) / 2;
20216
20209
  return trianglLeftOffset(ctx, r, x, y, offset);
20217
20210
  }
20218
20211
  }
@@ -20232,11 +20225,11 @@ class TriangleRightSymbol extends BaseSymbol {
20232
20225
  this.pathStr = 'M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z';
20233
20226
  }
20234
20227
  draw(ctx, size, x, y) {
20235
- const r = size / 2;
20228
+ const r = this.parseSize(size) / 2;
20236
20229
  return trianglRightOffset(ctx, r, x, y);
20237
20230
  }
20238
20231
  drawOffset(ctx, size, x, y, offset) {
20239
- const r = size / 2;
20232
+ const r = this.parseSize(size) / 2;
20240
20233
  return trianglRightOffset(ctx, r, x, y, offset);
20241
20234
  }
20242
20235
  }
@@ -20256,11 +20249,11 @@ class TriangleDownSymbol extends BaseSymbol {
20256
20249
  this.pathStr = 'M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z';
20257
20250
  }
20258
20251
  draw(ctx, size, x, y) {
20259
- const r = size / 2;
20252
+ const r = this.parseSize(size) / 2;
20260
20253
  return trianglDownOffset(ctx, r, x, y);
20261
20254
  }
20262
20255
  drawOffset(ctx, size, x, y, offset) {
20263
- const r = size / 2;
20256
+ const r = this.parseSize(size) / 2;
20264
20257
  return trianglDownOffset(ctx, r, x, y, offset);
20265
20258
  }
20266
20259
  }
@@ -20282,11 +20275,11 @@ class ThinTriangleSymbol extends BaseSymbol {
20282
20275
  this.pathStr = 'M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z';
20283
20276
  }
20284
20277
  draw(ctx, size, x, y) {
20285
- const r = size / 2 / sqrt3;
20278
+ const r = this.parseSize(size) / 2 / sqrt3;
20286
20279
  return thinTriangle(ctx, r, x, y);
20287
20280
  }
20288
20281
  drawOffset(ctx, size, x, y, offset) {
20289
- const r = size / 2 / sqrt3 + offset;
20282
+ const r = this.parseSize(size) / 2 / sqrt3 + offset;
20290
20283
  return thinTriangle(ctx, r, x, y);
20291
20284
  }
20292
20285
  }
@@ -20306,11 +20299,11 @@ class Arrow2LeftSymbol extends BaseSymbol {
20306
20299
  this.pathStr = 'M 0.25 -0.5 L -0.25 0 l 0.25 0.5';
20307
20300
  }
20308
20301
  draw(ctx, size, transX, transY) {
20309
- const r = size / 4;
20302
+ const r = this.parseSize(size) / 4;
20310
20303
  return arrow2Left(ctx, r, transX, transY);
20311
20304
  }
20312
20305
  drawOffset(ctx, size, transX, transY, offset) {
20313
- const r = size / 4 + offset;
20306
+ const r = this.parseSize(size) / 4 + offset;
20314
20307
  return arrow2Left(ctx, r, transX, transY);
20315
20308
  }
20316
20309
  }
@@ -20330,11 +20323,11 @@ class Arrow2RightSymbol extends BaseSymbol {
20330
20323
  this.pathStr = 'M -0.25 -0.5 l 0.25 0 l -0.25 0.5';
20331
20324
  }
20332
20325
  draw(ctx, size, transX, transY) {
20333
- const r = size / 4;
20326
+ const r = this.parseSize(size) / 4;
20334
20327
  return arrow2Right(ctx, r, transX, transY);
20335
20328
  }
20336
20329
  drawOffset(ctx, size, transX, transY, offset) {
20337
- const r = size / 4 + offset;
20330
+ const r = this.parseSize(size) / 4 + offset;
20338
20331
  return arrow2Right(ctx, r, transX, transY);
20339
20332
  }
20340
20333
  }
@@ -20354,11 +20347,11 @@ class Arrow2UpSymbol extends BaseSymbol {
20354
20347
  this.pathStr = 'M -0.5 0.25 L 0 -0.25 l 0.5 0.25';
20355
20348
  }
20356
20349
  draw(ctx, size, transX, transY) {
20357
- const r = size / 4;
20350
+ const r = this.parseSize(size) / 4;
20358
20351
  return arrow2Up(ctx, r, transX, transY);
20359
20352
  }
20360
20353
  drawOffset(ctx, size, transX, transY, offset) {
20361
- const r = size / 4 + offset;
20354
+ const r = this.parseSize(size) / 4 + offset;
20362
20355
  return arrow2Up(ctx, r, transX, transY);
20363
20356
  }
20364
20357
  }
@@ -20378,11 +20371,11 @@ class Arrow2DownSymbol extends BaseSymbol {
20378
20371
  this.pathStr = 'M -0.5 -0.25 L 0 0.25 l 0.5 -0.25';
20379
20372
  }
20380
20373
  draw(ctx, size, transX, transY) {
20381
- const r = size / 4;
20374
+ const r = this.parseSize(size) / 4;
20382
20375
  return arrow2Down(ctx, r, transX, transY);
20383
20376
  }
20384
20377
  drawOffset(ctx, size, transX, transY, offset) {
20385
- const r = size / 4 + offset;
20378
+ const r = this.parseSize(size) / 4 + offset;
20386
20379
  return arrow2Down(ctx, r, transX, transY);
20387
20380
  }
20388
20381
  }
@@ -20400,15 +20393,15 @@ class LineVSymbol extends BaseSymbol {
20400
20393
  this.pathStr = 'M0,-0.5L0,0.5';
20401
20394
  }
20402
20395
  draw(ctx, size, x, y, z) {
20403
- const r = size / 2;
20396
+ const r = this.parseSize(size) / 2;
20404
20397
  return lineV(ctx, r, x, y);
20405
20398
  }
20406
20399
  drawOffset(ctx, size, x, y, offset, z) {
20407
- const r = size / 2 + offset;
20400
+ const r = this.parseSize(size) / 2 + offset;
20408
20401
  return lineV(ctx, r, x, y);
20409
20402
  }
20410
20403
  drawToSvgPath(size, x, y, z) {
20411
- const r = size / 2;
20404
+ const r = this.parseSize(size) / 2;
20412
20405
  return `M ${x}, ${y - r} L ${x},${y + r}`;
20413
20406
  }
20414
20407
  }
@@ -20426,15 +20419,15 @@ class LineHSymbol extends BaseSymbol {
20426
20419
  this.pathStr = 'M-0.5,0L0.5,0';
20427
20420
  }
20428
20421
  draw(ctx, size, x, y, z) {
20429
- const r = size / 2;
20422
+ const r = this.parseSize(size) / 2;
20430
20423
  return lineH(ctx, r, x, y);
20431
20424
  }
20432
20425
  drawOffset(ctx, size, x, y, offset, z) {
20433
- const r = size / 2 + offset;
20426
+ const r = this.parseSize(size) / 2 + offset;
20434
20427
  return lineH(ctx, r, x, y);
20435
20428
  }
20436
20429
  drawToSvgPath(size, x, y, z) {
20437
- const r = size / 2;
20430
+ const r = this.parseSize(size) / 2;
20438
20431
  return `M ${x - r}, ${y} L ${x + r},${y}`;
20439
20432
  }
20440
20433
  }
@@ -20454,15 +20447,15 @@ class CloseSymbol extends BaseSymbol {
20454
20447
  this.pathStr = 'M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5';
20455
20448
  }
20456
20449
  draw(ctx, size, x, y, z) {
20457
- const r = size / 2;
20450
+ const r = this.parseSize(size) / 2;
20458
20451
  return close(ctx, r, x, y);
20459
20452
  }
20460
20453
  drawOffset(ctx, size, x, y, offset, z) {
20461
- const r = size / 2 + offset;
20454
+ const r = this.parseSize(size) / 2 + offset;
20462
20455
  return close(ctx, r, x, y);
20463
20456
  }
20464
20457
  drawToSvgPath(size, x, y, z) {
20465
- const r = size / 2;
20458
+ const r = this.parseSize(size) / 2;
20466
20459
  return `M ${x - r}, ${y - r} L ${x + r},${y + r} M ${x + r}, ${y - r} L ${x - r},${y + r}`;
20467
20460
  }
20468
20461
  }
@@ -20513,6 +20506,7 @@ class CustomSymbolClass {
20513
20506
  this.isSvg = isSvg;
20514
20507
  }
20515
20508
  drawOffset(ctx, size, x, y, offset, z, cb) {
20509
+ size = this.parseSize(size);
20516
20510
  if (this.isSvg) {
20517
20511
  if (!this.svgCache) {
20518
20512
  return false;
@@ -20528,9 +20522,14 @@ class CustomSymbolClass {
20528
20522
  return false;
20529
20523
  }
20530
20524
  draw(ctx, size, x, y, z, cb) {
20525
+ size = this.parseSize(size);
20531
20526
  return this.drawOffset(ctx, size, x, y, 0, z, cb);
20532
20527
  }
20528
+ parseSize(size) {
20529
+ return isNumber(size) ? size : Math.min(size[0], size[1]);
20530
+ }
20533
20531
  bounds(size, bounds) {
20532
+ size = this.parseSize(size);
20534
20533
  if (this.isSvg) {
20535
20534
  if (!this.svgCache) {
20536
20535
  return;
@@ -21550,7 +21549,8 @@ class Paragraph {
21550
21549
  left = 0;
21551
21550
  baseline = 0;
21552
21551
  }
21553
- if (this.character.stroke) {
21552
+ const { lineWidth = 1 } = this.character;
21553
+ if (this.character.stroke && lineWidth) {
21554
21554
  applyStrokeStyle(ctx, this.character);
21555
21555
  ctx.strokeText(text, left, baseline);
21556
21556
  }
@@ -24707,6 +24707,7 @@ class Stage extends Group {
24707
24707
  constructor(params = {}) {
24708
24708
  var _a;
24709
24709
  super({});
24710
+ this.tickedBeforeRender = true;
24710
24711
  this._onVisibleChange = (visible) => {
24711
24712
  if (this._skipRender < 0) {
24712
24713
  return;
@@ -24733,6 +24734,15 @@ class Stage extends Group {
24733
24734
  this._afterRender && this._afterRender(stage);
24734
24735
  this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));
24735
24736
  this._afterNextRenderCbs = null;
24737
+ this.tickedBeforeRender = false;
24738
+ };
24739
+ this.afterTickCb = () => {
24740
+ var _a;
24741
+ this.tickedBeforeRender = true;
24742
+ if (((_a = this.params.optimize) === null || _a === void 0 ? void 0 : _a.tickRenderMode) === 'performance') ;
24743
+ else {
24744
+ this.state !== 'rendering' && this.render();
24745
+ }
24736
24746
  };
24737
24747
  this.params = params;
24738
24748
  this.theme = new Theme();
@@ -24800,6 +24810,7 @@ class Stage extends Group {
24800
24810
  if (params.background && isString(this._background) && this._background.includes('/')) {
24801
24811
  this.setAttributes({ background: this._background });
24802
24812
  }
24813
+ this.ticker.on('afterTick', this.afterTickCb);
24803
24814
  }
24804
24815
  pauseRender(sr = -1) {
24805
24816
  this._skipRender = sr;
@@ -25113,6 +25124,9 @@ class Stage extends Group {
25113
25124
  this.timeline.resume();
25114
25125
  const state = this.state;
25115
25126
  this.state = 'rendering';
25127
+ if (!this.tickedBeforeRender) {
25128
+ this.ticker.trySyncTickStatus();
25129
+ }
25116
25130
  this.layerService.prepareStageLayer(this);
25117
25131
  if (!this._skipRender) {
25118
25132
  this.lastRenderparams = params;
@@ -25310,6 +25324,7 @@ class Stage extends Group {
25310
25324
  }
25311
25325
  this.window.release();
25312
25326
  this.ticker.remTimeline(this.timeline);
25327
+ this.ticker.removeListener('afterTick', this.afterTickCb);
25313
25328
  this.renderService.renderTreeRoots = [];
25314
25329
  }
25315
25330
  setStage(stage) {
@@ -25422,25 +25437,6 @@ function createStage(params) {
25422
25437
  return new Stage(params);
25423
25438
  }
25424
25439
 
25425
- var params;
25426
- (function (params) {
25427
- params[params["W"] = 1] = "W";
25428
- params[params["H"] = 2] = "H";
25429
- params[params["WH"] = 3] = "WH";
25430
- })(params || (params = {}));
25431
-
25432
- const strCommandMap = [
25433
- 'arc',
25434
- 'arcTo',
25435
- 'bezierCurveTo',
25436
- 'closePath',
25437
- 'ellipse',
25438
- 'lineTo',
25439
- 'moveTo',
25440
- 'quadraticCurveTo',
25441
- 'rect'
25442
- ];
25443
-
25444
25440
  const initMatrix = new Matrix(1, 0, 0, 1, 0, 0);
25445
25441
  const globalPoint = { x: 0, y: 0 };
25446
25442
  let EmptyContext2d = class EmptyContext2d {
@@ -28712,4 +28708,4 @@ const registerFlexLayoutPlugin = () => {
28712
28708
  Factory.registerPlugin('FlexLayoutPlugin', FlexLayoutPlugin);
28713
28709
  };
28714
28710
 
28715
- 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, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, 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, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, 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, 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, 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, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, 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, 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, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyphGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
28711
+ 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, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, 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, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, 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, 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, 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, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, 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, 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, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyphGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };