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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) 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/common/path-svg.js +3 -3
  8. package/cjs/common/path-svg.js.map +1 -1
  9. package/cjs/common/simplify.js +2 -3
  10. package/cjs/common/simplify.js.map +1 -1
  11. package/cjs/core/contributions/textMeasure/AtextMeasure.d.ts +56 -4
  12. package/cjs/core/contributions/textMeasure/AtextMeasure.js +119 -18
  13. package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  14. package/cjs/core/contributions/textMeasure/layout.d.ts +8 -3
  15. package/cjs/core/contributions/textMeasure/layout.js +45 -40
  16. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  17. package/cjs/core/stage.d.ts +5 -0
  18. package/cjs/core/stage.js +20 -7
  19. package/cjs/core/stage.js.map +1 -1
  20. package/cjs/core/window.js +3 -2
  21. package/cjs/core/window.js.map +1 -1
  22. package/cjs/event/event-manager.d.ts +1 -0
  23. package/cjs/event/event-manager.js +1 -1
  24. package/cjs/event/event-manager.js.map +1 -1
  25. package/cjs/event/event-system.js +2 -1
  26. package/cjs/event/event-system.js.map +1 -1
  27. package/cjs/graphic/builtin-symbol/arrow.js +2 -2
  28. package/cjs/graphic/builtin-symbol/arrow.js.map +1 -1
  29. package/cjs/graphic/builtin-symbol/arrow2-down.js +2 -2
  30. package/cjs/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  31. package/cjs/graphic/builtin-symbol/arrow2-left.js +2 -2
  32. package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  33. package/cjs/graphic/builtin-symbol/arrow2-right.js +2 -2
  34. package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  35. package/cjs/graphic/builtin-symbol/arrow2-up.js +2 -2
  36. package/cjs/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  37. package/cjs/graphic/builtin-symbol/base.d.ts +1 -0
  38. package/cjs/graphic/builtin-symbol/base.js +3 -0
  39. package/cjs/graphic/builtin-symbol/base.js.map +1 -1
  40. package/cjs/graphic/builtin-symbol/circle.js +3 -3
  41. package/cjs/graphic/builtin-symbol/circle.js.map +1 -1
  42. package/cjs/graphic/builtin-symbol/close.js +3 -3
  43. package/cjs/graphic/builtin-symbol/close.js.map +1 -1
  44. package/cjs/graphic/builtin-symbol/cross.js +2 -2
  45. package/cjs/graphic/builtin-symbol/cross.js.map +1 -1
  46. package/cjs/graphic/builtin-symbol/diamond.js +3 -3
  47. package/cjs/graphic/builtin-symbol/diamond.js.map +1 -1
  48. package/cjs/graphic/builtin-symbol/line-h.js +3 -3
  49. package/cjs/graphic/builtin-symbol/line-h.js.map +1 -1
  50. package/cjs/graphic/builtin-symbol/line-v.js +3 -3
  51. package/cjs/graphic/builtin-symbol/line-v.js.map +1 -1
  52. package/cjs/graphic/builtin-symbol/square.js +2 -2
  53. package/cjs/graphic/builtin-symbol/square.js.map +1 -1
  54. package/cjs/graphic/builtin-symbol/star.js +2 -2
  55. package/cjs/graphic/builtin-symbol/star.js.map +1 -1
  56. package/cjs/graphic/builtin-symbol/stroke.js +2 -2
  57. package/cjs/graphic/builtin-symbol/stroke.js.map +1 -1
  58. package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -2
  59. package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  60. package/cjs/graphic/builtin-symbol/triangle-down.js +2 -2
  61. package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
  62. package/cjs/graphic/builtin-symbol/triangle-left.js +2 -2
  63. package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
  64. package/cjs/graphic/builtin-symbol/triangle-right.js +2 -2
  65. package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
  66. package/cjs/graphic/builtin-symbol/triangle-up.js +2 -2
  67. package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
  68. package/cjs/graphic/builtin-symbol/utils.d.ts +1 -0
  69. package/cjs/graphic/builtin-symbol/utils.js +6 -3
  70. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  71. package/cjs/graphic/builtin-symbol/wedge.js +2 -2
  72. package/cjs/graphic/builtin-symbol/wedge.js.map +1 -1
  73. package/cjs/graphic/builtin-symbol/wye.js +2 -2
  74. package/cjs/graphic/builtin-symbol/wye.js.map +1 -1
  75. package/cjs/graphic/config.d.ts +1 -1
  76. package/cjs/graphic/config.js +9 -3
  77. package/cjs/graphic/config.js.map +1 -1
  78. package/cjs/graphic/richtext/paragraph.js +3 -1
  79. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  80. package/cjs/graphic/text.d.ts +11 -11
  81. package/cjs/graphic/text.js +104 -170
  82. package/cjs/graphic/text.js.map +1 -1
  83. package/cjs/graphic/wrap-text.js +16 -4
  84. package/cjs/graphic/wrap-text.js.map +1 -1
  85. package/cjs/interface/animate.d.ts +3 -1
  86. package/cjs/interface/animate.js.map +1 -1
  87. package/cjs/interface/context.d.ts +1 -0
  88. package/cjs/interface/context.js.map +1 -1
  89. package/cjs/interface/graphic/text.d.ts +11 -3
  90. package/cjs/interface/graphic/text.js +6 -1
  91. package/cjs/interface/graphic/text.js.map +1 -1
  92. package/cjs/interface/graphic.d.ts +2 -0
  93. package/cjs/interface/graphic.js.map +1 -1
  94. package/cjs/interface/stage.d.ts +2 -0
  95. package/cjs/interface/stage.js.map +1 -1
  96. package/cjs/interface/text.d.ts +9 -1
  97. package/cjs/interface/text.js.map +1 -1
  98. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.d.ts +16 -0
  99. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js +48 -0
  100. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -0
  101. package/cjs/render/contributions/render/arc-render.js +30 -18
  102. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  103. package/cjs/render/contributions/render/area-render.js +40 -36
  104. package/cjs/render/contributions/render/area-render.js.map +1 -1
  105. package/cjs/render/contributions/render/circle-render.js +10 -5
  106. package/cjs/render/contributions/render/circle-render.js.map +1 -1
  107. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  108. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  109. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  110. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  111. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  112. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  113. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  114. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  115. package/cjs/render/contributions/render/group-render.js +10 -5
  116. package/cjs/render/contributions/render/group-render.js.map +1 -1
  117. package/cjs/render/contributions/render/image-render.js +26 -22
  118. package/cjs/render/contributions/render/image-render.js.map +1 -1
  119. package/cjs/render/contributions/render/path-render.js +10 -5
  120. package/cjs/render/contributions/render/path-render.js.map +1 -1
  121. package/cjs/render/contributions/render/polygon-render.js +10 -5
  122. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  123. package/cjs/render/contributions/render/rect-render.js +10 -5
  124. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  125. package/cjs/render/contributions/render/symbol-render.js +18 -8
  126. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  127. package/cjs/render/contributions/render/text-render.d.ts +1 -1
  128. package/cjs/render/contributions/render/text-render.js +24 -46
  129. package/cjs/render/contributions/render/text-render.js.map +1 -1
  130. package/dist/index.es.js +1020 -818
  131. package/es/animate/Ticker/default-ticker.d.ts +4 -2
  132. package/es/animate/Ticker/default-ticker.js +9 -6
  133. package/es/animate/Ticker/default-ticker.js.map +1 -1
  134. package/es/animate/custom-animate.d.ts +2 -0
  135. package/es/animate/custom-animate.js +11 -2
  136. package/es/animate/custom-animate.js.map +1 -1
  137. package/es/common/path-svg.js +3 -3
  138. package/es/common/path-svg.js.map +1 -1
  139. package/es/common/simplify.js +2 -3
  140. package/es/common/simplify.js.map +1 -1
  141. package/es/core/contributions/textMeasure/AtextMeasure.d.ts +56 -4
  142. package/es/core/contributions/textMeasure/AtextMeasure.js +122 -17
  143. package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  144. package/es/core/contributions/textMeasure/layout.d.ts +8 -3
  145. package/es/core/contributions/textMeasure/layout.js +45 -40
  146. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  147. package/es/core/stage.d.ts +5 -0
  148. package/es/core/stage.js +21 -6
  149. package/es/core/stage.js.map +1 -1
  150. package/es/core/window.js +3 -1
  151. package/es/core/window.js.map +1 -1
  152. package/es/event/event-manager.d.ts +1 -0
  153. package/es/event/event-manager.js +1 -1
  154. package/es/event/event-manager.js.map +1 -1
  155. package/es/event/event-system.js +2 -1
  156. package/es/event/event-system.js.map +1 -1
  157. package/es/graphic/builtin-symbol/arrow.js +2 -2
  158. package/es/graphic/builtin-symbol/arrow.js.map +1 -1
  159. package/es/graphic/builtin-symbol/arrow2-down.js +2 -2
  160. package/es/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  161. package/es/graphic/builtin-symbol/arrow2-left.js +2 -2
  162. package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  163. package/es/graphic/builtin-symbol/arrow2-right.js +2 -2
  164. package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  165. package/es/graphic/builtin-symbol/arrow2-up.js +2 -2
  166. package/es/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  167. package/es/graphic/builtin-symbol/base.d.ts +1 -0
  168. package/es/graphic/builtin-symbol/base.js +3 -0
  169. package/es/graphic/builtin-symbol/base.js.map +1 -1
  170. package/es/graphic/builtin-symbol/circle.js +3 -3
  171. package/es/graphic/builtin-symbol/circle.js.map +1 -1
  172. package/es/graphic/builtin-symbol/close.js +3 -3
  173. package/es/graphic/builtin-symbol/close.js.map +1 -1
  174. package/es/graphic/builtin-symbol/cross.js +2 -2
  175. package/es/graphic/builtin-symbol/cross.js.map +1 -1
  176. package/es/graphic/builtin-symbol/diamond.js +3 -3
  177. package/es/graphic/builtin-symbol/diamond.js.map +1 -1
  178. package/es/graphic/builtin-symbol/line-h.js +3 -3
  179. package/es/graphic/builtin-symbol/line-h.js.map +1 -1
  180. package/es/graphic/builtin-symbol/line-v.js +3 -3
  181. package/es/graphic/builtin-symbol/line-v.js.map +1 -1
  182. package/es/graphic/builtin-symbol/square.js +2 -2
  183. package/es/graphic/builtin-symbol/square.js.map +1 -1
  184. package/es/graphic/builtin-symbol/star.js +2 -2
  185. package/es/graphic/builtin-symbol/star.js.map +1 -1
  186. package/es/graphic/builtin-symbol/stroke.js +2 -2
  187. package/es/graphic/builtin-symbol/stroke.js.map +1 -1
  188. package/es/graphic/builtin-symbol/thin-triangle.js +2 -2
  189. package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  190. package/es/graphic/builtin-symbol/triangle-down.js +2 -2
  191. package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
  192. package/es/graphic/builtin-symbol/triangle-left.js +2 -2
  193. package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
  194. package/es/graphic/builtin-symbol/triangle-right.js +2 -2
  195. package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
  196. package/es/graphic/builtin-symbol/triangle-up.js +2 -2
  197. package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
  198. package/es/graphic/builtin-symbol/utils.d.ts +1 -0
  199. package/es/graphic/builtin-symbol/utils.js +7 -4
  200. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  201. package/es/graphic/builtin-symbol/wedge.js +2 -2
  202. package/es/graphic/builtin-symbol/wedge.js.map +1 -1
  203. package/es/graphic/builtin-symbol/wye.js +2 -2
  204. package/es/graphic/builtin-symbol/wye.js.map +1 -1
  205. package/es/graphic/config.d.ts +1 -1
  206. package/es/graphic/config.js +10 -2
  207. package/es/graphic/config.js.map +1 -1
  208. package/es/graphic/richtext/paragraph.js +4 -2
  209. package/es/graphic/richtext/paragraph.js.map +1 -1
  210. package/es/graphic/text.d.ts +11 -11
  211. package/es/graphic/text.js +103 -165
  212. package/es/graphic/text.js.map +1 -1
  213. package/es/graphic/wrap-text.js +16 -4
  214. package/es/graphic/wrap-text.js.map +1 -1
  215. package/es/interface/animate.d.ts +3 -1
  216. package/es/interface/animate.js.map +1 -1
  217. package/es/interface/context.d.ts +1 -0
  218. package/es/interface/context.js.map +1 -1
  219. package/es/interface/graphic/text.d.ts +11 -3
  220. package/es/interface/graphic/text.js +6 -1
  221. package/es/interface/graphic/text.js.map +1 -1
  222. package/es/interface/graphic.d.ts +2 -0
  223. package/es/interface/graphic.js.map +1 -1
  224. package/es/interface/stage.d.ts +2 -0
  225. package/es/interface/stage.js.map +1 -1
  226. package/es/interface/text.d.ts +9 -1
  227. package/es/interface/text.js.map +1 -1
  228. package/es/plugins/builtin-plugin/auto-refresh-plugin.d.ts +16 -0
  229. package/es/plugins/builtin-plugin/auto-refresh-plugin.js +41 -0
  230. package/es/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -0
  231. package/es/render/contributions/render/arc-render.js +30 -18
  232. package/es/render/contributions/render/arc-render.js.map +1 -1
  233. package/es/render/contributions/render/area-render.js +40 -36
  234. package/es/render/contributions/render/area-render.js.map +1 -1
  235. package/es/render/contributions/render/circle-render.js +10 -5
  236. package/es/render/contributions/render/circle-render.js.map +1 -1
  237. package/es/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  238. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  239. package/es/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  240. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  241. package/es/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  242. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  243. package/es/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  244. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  245. package/es/render/contributions/render/group-render.js +10 -5
  246. package/es/render/contributions/render/group-render.js.map +1 -1
  247. package/es/render/contributions/render/image-render.js +26 -22
  248. package/es/render/contributions/render/image-render.js.map +1 -1
  249. package/es/render/contributions/render/path-render.js +10 -5
  250. package/es/render/contributions/render/path-render.js.map +1 -1
  251. package/es/render/contributions/render/polygon-render.js +10 -5
  252. package/es/render/contributions/render/polygon-render.js.map +1 -1
  253. package/es/render/contributions/render/rect-render.js +10 -5
  254. package/es/render/contributions/render/rect-render.js.map +1 -1
  255. package/es/render/contributions/render/symbol-render.js +18 -8
  256. package/es/render/contributions/render/symbol-render.js.map +1 -1
  257. package/es/render/contributions/render/text-render.d.ts +1 -1
  258. package/es/render/contributions/render/text-render.js +23 -45
  259. package/es/render/contributions/render/text-render.js.map +1 -1
  260. package/package.json +4 -3
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, PointService, Point, abs, max, min, atan2, epsilon, Matrix, pi2, Logger, isPointInLine, pi, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, isString, has, isUndefined, isArray, cos, sin, pointAt, isNumber, getDecimalPlaces, isValidNumber, clamp, getAngleByPoint, isNumberClose, isNil, Bounds, getIntersectPoint, Color, DEFAULT_COLORS, OBBBounds, normalTransform, isValidUrl, isBase64, acos, sqrt, LRU, lowerCamelCaseToMiddle, isValid, transformBoundsWithMatrix, arrayEqual, getContextFont, rotatePoint, clampAngleByRadian, asin, getRectIntersect, isRectIntersect, merge, calculateAnchorOfBounds, styleStringToObject } from '@visactor/vutils';
1
+ import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, PointService, Point, abs, max, min, atan2, epsilon, Matrix, pi2, Logger, isPointInLine, pi, isNumberClose, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, isString, has, isUndefined, isArray, cos, sin, pointAt, isNumber, getDecimalPlaces, isValidNumber, clamp, getAngleByPoint, isNil, Bounds, getIntersectPoint, Color, DEFAULT_COLORS, OBBBounds, normalTransform, isValidUrl, isBase64, acos, sqrt, LRU, lowerCamelCaseToMiddle, isValid, transformBoundsWithMatrix, arrayEqual, getContextFont, rotatePoint, clampAngleByRadian, asin, getRectIntersect, isRectIntersect, merge, calculateAnchorOfBounds, styleStringToObject } from '@visactor/vutils';
2
2
 
3
3
  class Generator {
4
4
  static GenAutoIncrementId() {
@@ -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) {
@@ -1351,12 +1377,19 @@ function parseSvgPath(str) {
1351
1377
  standardCommandLen = commandLengths[commandChar];
1352
1378
  if (currCommandData.length - 1 > standardCommandLen) {
1353
1379
  let subCommand;
1380
+ let bestCommandChar = commandChar;
1354
1381
  for (let i = 1, len = currCommandData.length; i < len; i += standardCommandLen) {
1355
- subCommand = [commandChar];
1382
+ subCommand = [bestCommandChar];
1356
1383
  for (let j = i, subLen = i + standardCommandLen; j < subLen; j++) {
1357
1384
  subCommand.push(currCommandData[j]);
1358
1385
  }
1359
1386
  result.push(subCommand);
1387
+ if (bestCommandChar === 'm') {
1388
+ bestCommandChar = 'l';
1389
+ }
1390
+ else if (bestCommandChar === 'M') {
1391
+ bestCommandChar = 'L';
1392
+ }
1360
1393
  }
1361
1394
  }
1362
1395
  else {
@@ -3009,6 +3042,7 @@ const DefaultStrokeStyle = Object.assign({ outerBorder: Object.assign(Object.ass
3009
3042
  const DefaultTextStyle = {
3010
3043
  text: '',
3011
3044
  maxLineWidth: Infinity,
3045
+ maxWidth: Infinity,
3012
3046
  textAlign: 'left',
3013
3047
  textBaseline: 'alphabetic',
3014
3048
  fontSize: 16,
@@ -3033,7 +3067,9 @@ const DefaultTextStyle = {
3033
3067
  suffixPosition: 'end',
3034
3068
  underlineDash: [],
3035
3069
  underlineOffset: 0,
3036
- disableAutoClipedPoptip: undefined
3070
+ disableAutoClipedPoptip: undefined,
3071
+ measureMode: MeasureModeEnum.fontBounding,
3072
+ keepCenterInLine: false
3037
3073
  };
3038
3074
  const DefaultPickStyle = {
3039
3075
  pickStrokeBuffer: 0
@@ -3048,7 +3084,7 @@ const DefaultConnectAttribute = {
3048
3084
  const DefaultDebugAttribute = {
3049
3085
  _debug_bounds: false
3050
3086
  };
3051
- 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, renderStyle: 'default', pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true, shadowRootIdx: 1, globalZIndex: 1, globalCompositeOperation: '', overflow: 'hidden', shadowPickMode: 'graphic' }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
3087
+ 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);
3052
3088
  function addAttributeToPrototype(obj, c, keys) {
3053
3089
  keys.forEach(key => {
3054
3090
  c.prototype[key] = obj[key];
@@ -3063,7 +3099,7 @@ const DefaultCircleAttribute = Object.assign(Object.assign({}, DefaultAttribute)
3063
3099
  const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, cornerRadius: 0, path: [], clip: false, visibleAll: true, display: 'relative', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'flex-start', alignItems: 'flex-start', alignContent: 'flex-start', baseOpacity: 1 });
3064
3100
  const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: '', width: 0, height: 0, cornerRadius: 0, clip: false });
3065
3101
  const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, clipRangeByDimension: 'default', closePath: false, curveTension: 1 });
3066
- const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: new CustomPath2D(), customPath: () => {
3102
+ const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: new CustomPath2D(), fillStrokeOrder: 1, customPath: () => {
3067
3103
  Logger.getInstance().warn('空函数');
3068
3104
  } });
3069
3105
  const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute), { points: [], cornerRadius: 0, closePath: true });
@@ -3242,13 +3278,33 @@ let ATextMeasure = class ATextMeasure {
3242
3278
  this.context = service.context;
3243
3279
  service.bindTextMeasure(this);
3244
3280
  }
3245
- measureTextWidth(text, options) {
3246
- if (!this.context) {
3247
- return this.estimate(text, options).width;
3248
- }
3281
+ _measureTextWithoutAlignBaseline(text, options, compatible) {
3249
3282
  this.context.setTextStyleWithoutAlignBaseline(options);
3250
- const textMeasure = this.context.measureText(text);
3251
- return textMeasure.width;
3283
+ const metrics = this.context.measureText(text);
3284
+ return compatible ? this.compatibleMetrics(metrics, options) : metrics;
3285
+ }
3286
+ _measureTextWithAlignBaseline(text, options, compatible) {
3287
+ this.context.setTextStyle(options);
3288
+ const metrics = this.context.measureText(text);
3289
+ return compatible ? this.compatibleMetrics(metrics, options) : metrics;
3290
+ }
3291
+ compatibleMetrics(metrics, options) {
3292
+ if (metrics.actualBoundingBoxAscent == null ||
3293
+ metrics.actualBoundingBoxDescent == null ||
3294
+ metrics.fontBoundingBoxAscent == null ||
3295
+ metrics.fontBoundingBoxDescent == null) {
3296
+ const { ascent, descent } = this.measureTextBoundADscentEstimate(options);
3297
+ metrics.actualBoundingBoxAscent = ascent;
3298
+ metrics.actualBoundingBoxDescent = descent;
3299
+ metrics.fontBoundingBoxAscent = ascent;
3300
+ metrics.fontBoundingBoxDescent = descent;
3301
+ }
3302
+ if (metrics.actualBoundingBoxLeft == null || metrics.actualBoundingBoxRight == null) {
3303
+ const { left, right } = this.measureTextBoundLeftRightEstimate(options);
3304
+ metrics.actualBoundingBoxLeft = left;
3305
+ metrics.actualBoundingBoxRight = right;
3306
+ }
3307
+ return metrics;
3252
3308
  }
3253
3309
  estimate(text, { fontSize = DefaultTextAttribute.fontSize }) {
3254
3310
  let eCharLen = 0;
@@ -3261,24 +3317,135 @@ let ATextMeasure = class ATextMeasure {
3261
3317
  height: fontSize
3262
3318
  };
3263
3319
  }
3264
- measureTextPixelHeight(text, options) {
3320
+ measureTextWidth(text, options, textMeasure) {
3321
+ if (!this.context) {
3322
+ return this.estimate(text, options).width;
3323
+ }
3324
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options);
3325
+ return textMeasure.width;
3326
+ }
3327
+ measureTextBoundsWidth(text, options, textMeasure) {
3328
+ if (!this.context) {
3329
+ return this.estimate(text, options).width;
3330
+ }
3331
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options);
3332
+ return textMeasure.width;
3333
+ }
3334
+ measureTextBoundsLeftRight(text, options, textMeasure) {
3335
+ if (!this.context) {
3336
+ return this.measureTextBoundLeftRightEstimate(options);
3337
+ }
3338
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithAlignBaseline(text, options, true);
3339
+ return {
3340
+ left: textMeasure.actualBoundingBoxLeft,
3341
+ right: textMeasure.actualBoundingBoxRight
3342
+ };
3343
+ }
3344
+ measureTextPixelHeight(text, options, textMeasure) {
3265
3345
  var _a;
3266
3346
  if (!this.context) {
3267
3347
  return (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
3268
3348
  }
3269
- this.context.setTextStyleWithoutAlignBaseline(options);
3270
- const textMeasure = this.context.measureText(text);
3349
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options, true);
3271
3350
  return Math.abs(textMeasure.actualBoundingBoxAscent - textMeasure.actualBoundingBoxDescent);
3272
3351
  }
3273
- measureTextBoundHieght(text, options) {
3352
+ measureTextPixelADscent(text, options, textMeasure) {
3353
+ if (!this.context) {
3354
+ return this.measureTextBoundADscentEstimate(options);
3355
+ }
3356
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithAlignBaseline(text, options, true);
3357
+ return {
3358
+ ascent: textMeasure.actualBoundingBoxAscent,
3359
+ descent: textMeasure.actualBoundingBoxDescent
3360
+ };
3361
+ }
3362
+ measureTextBoundHieght(text, options, textMeasure) {
3274
3363
  var _a;
3275
3364
  if (!this.context) {
3276
3365
  return (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
3277
3366
  }
3278
- this.context.setTextStyleWithoutAlignBaseline(options);
3279
- const textMeasure = this.context.measureText(text);
3367
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithoutAlignBaseline(text, options, true);
3280
3368
  return Math.abs(textMeasure.fontBoundingBoxAscent - textMeasure.fontBoundingBoxDescent);
3281
3369
  }
3370
+ measureTextBoundADscent(text, options, textMeasure) {
3371
+ if (!this.context) {
3372
+ return this.measureTextBoundADscentEstimate(options);
3373
+ }
3374
+ textMeasure = textMeasure !== null && textMeasure !== void 0 ? textMeasure : this._measureTextWithAlignBaseline(text, options, true);
3375
+ return {
3376
+ ascent: textMeasure.fontBoundingBoxAscent,
3377
+ descent: textMeasure.fontBoundingBoxDescent
3378
+ };
3379
+ }
3380
+ measureTextBoundADscentEstimate(options) {
3381
+ var _a;
3382
+ const fontSize = (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
3383
+ return {
3384
+ ascent: 0.79 * fontSize,
3385
+ descent: 0.21 * fontSize
3386
+ };
3387
+ }
3388
+ measureTextBoundLeftRightEstimate(options) {
3389
+ var _a;
3390
+ const fontSize = (_a = options.fontSize) !== null && _a !== void 0 ? _a : DefaultTextStyle.fontSize;
3391
+ const { textAlign } = options;
3392
+ if (textAlign === 'center') {
3393
+ return {
3394
+ left: fontSize / 2,
3395
+ right: fontSize / 2
3396
+ };
3397
+ }
3398
+ else if (textAlign === 'right' || textAlign === 'end') {
3399
+ return {
3400
+ left: fontSize,
3401
+ right: 0
3402
+ };
3403
+ }
3404
+ return {
3405
+ left: 0,
3406
+ right: fontSize
3407
+ };
3408
+ }
3409
+ measureTextPixelADscentAndWidth(text, options, mode) {
3410
+ if (!this.context) {
3411
+ return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), { width: this.estimate(text, options).width });
3412
+ }
3413
+ const out = this._measureTextWithoutAlignBaseline(text, options, true);
3414
+ if (mode === MeasureModeEnum.actualBounding) {
3415
+ return {
3416
+ ascent: out.actualBoundingBoxAscent,
3417
+ descent: out.actualBoundingBoxDescent,
3418
+ width: out.width
3419
+ };
3420
+ }
3421
+ else if (mode === MeasureModeEnum.estimate) {
3422
+ return Object.assign(Object.assign({}, this.measureTextBoundADscentEstimate(options)), { width: out.width });
3423
+ }
3424
+ else if (mode === MeasureModeEnum.fontBounding) {
3425
+ let ascent = out.fontBoundingBoxAscent;
3426
+ let descent = out.fontBoundingBoxDescent;
3427
+ if (out.actualBoundingBoxDescent && descent < out.actualBoundingBoxDescent) {
3428
+ const delta = out.actualBoundingBoxDescent - descent;
3429
+ descent += delta;
3430
+ ascent -= delta;
3431
+ }
3432
+ else if (out.actualBoundingBoxAscent && ascent < out.actualBoundingBoxAscent) {
3433
+ const delta = out.actualBoundingBoxAscent - ascent;
3434
+ ascent += delta;
3435
+ descent -= delta;
3436
+ }
3437
+ return {
3438
+ ascent,
3439
+ descent,
3440
+ width: out.width
3441
+ };
3442
+ }
3443
+ return {
3444
+ ascent: out.actualBoundingBoxAscent,
3445
+ descent: out.actualBoundingBoxDescent,
3446
+ width: out.width
3447
+ };
3448
+ }
3282
3449
  measureText(text, options) {
3283
3450
  if (!this.context) {
3284
3451
  return this.estimate(text, options);
@@ -3376,6 +3543,11 @@ let ATextMeasure = class ATextMeasure {
3376
3543
  return data;
3377
3544
  }
3378
3545
  _clipTextEnd(text, options, width, leftIdx, rightIdx) {
3546
+ if (leftIdx === rightIdx) {
3547
+ Logger.getInstance().warn(`【_clipTextEnd】不应该走到这里${text}, ${leftIdx}, ${rightIdx}`);
3548
+ const subText = text.substring(0, rightIdx + 1);
3549
+ return { str: subText, width: this.measureTextWidth(subText, options) };
3550
+ }
3379
3551
  const middleIdx = Math.floor((leftIdx + rightIdx) / 2);
3380
3552
  const subText = text.substring(0, middleIdx + 1);
3381
3553
  const strWidth = this.measureTextWidth(subText, options);
@@ -3406,25 +3578,25 @@ let ATextMeasure = class ATextMeasure {
3406
3578
  }
3407
3579
  _clipTextStart(text, options, width, leftIdx, rightIdx) {
3408
3580
  const middleIdx = Math.ceil((leftIdx + rightIdx) / 2);
3409
- const subText = text.substring(middleIdx - 1, text.length - 1);
3581
+ const subText = text.substring(middleIdx - 1, text.length);
3410
3582
  const strWidth = this.measureTextWidth(subText, options);
3411
3583
  let length;
3412
3584
  if (strWidth > width) {
3413
3585
  if (subText.length <= 1) {
3414
3586
  return { str: '', width: 0 };
3415
3587
  }
3416
- const str = text.substring(middleIdx, text.length - 1);
3588
+ const str = text.substring(middleIdx, text.length);
3417
3589
  length = this.measureTextWidth(str, options);
3418
3590
  if (length <= width) {
3419
3591
  return { str, width: length };
3420
3592
  }
3421
- return this._clipTextStart(text, options, width, middleIdx, text.length - 1);
3593
+ return this._clipTextStart(text, options, width, middleIdx, text.length);
3422
3594
  }
3423
3595
  else if (strWidth < width) {
3424
3596
  if (middleIdx <= 0) {
3425
3597
  return { str: text, width: this.measureTextWidth(text, options) };
3426
3598
  }
3427
- const str = text.substring(middleIdx - 2, text.length - 1);
3599
+ const str = text.substring(middleIdx - 2, text.length);
3428
3600
  length = this.measureTextWidth(str, options);
3429
3601
  if (length >= width) {
3430
3602
  return { str: subText, width: strWidth };
@@ -4446,8 +4618,8 @@ let DefaultWindow = class DefaultWindow {
4446
4618
  const viewBox = this._handler.getViewBox();
4447
4619
  return !(viewBox.x1 === 0 &&
4448
4620
  viewBox.y1 === 0 &&
4449
- this.width === viewBox.width() &&
4450
- this.height === viewBox.height());
4621
+ isNumberClose(this.width, viewBox.width()) &&
4622
+ isNumberClose(this.height, viewBox.height()));
4451
4623
  }
4452
4624
  isVisible(bbox) {
4453
4625
  return this._handler.isVisible(bbox);
@@ -5944,7 +6116,7 @@ class EventManager {
5944
6116
  this.dispatchEvent(clickEvent, 'dblclick');
5945
6117
  }
5946
6118
  }
5947
- else if (clickEvent.pointerType === 'touch') {
6119
+ else if (clickEvent.pointerType === 'touch' && this._config.supportsTouchEvents) {
5948
6120
  this.dispatchEvent(clickEvent, 'tap');
5949
6121
  if (clickHistory.clickCount === 2) {
5950
6122
  this.dispatchEvent(clickEvent, 'dbltap');
@@ -6403,7 +6575,8 @@ class EventSystem {
6403
6575
  };
6404
6576
  const { targetElement, resolution, rootNode, global, autoPreventDefault = false, clickInterval, supportsTouchEvents = global.supportsTouchEvents, supportsPointerEvents = global.supportsPointerEvents } = params;
6405
6577
  this.manager = new EventManager(rootNode, {
6406
- clickInterval
6578
+ clickInterval,
6579
+ supportsTouchEvents: supportsTouchEvents
6407
6580
  });
6408
6581
  this.globalObj = global;
6409
6582
  this.supportsPointerEvents = supportsPointerEvents;
@@ -6828,7 +7001,7 @@ class TimeOutTickHandler {
6828
7001
  }
6829
7002
  }
6830
7003
 
6831
- class DefaultTicker {
7004
+ class DefaultTicker extends EventEmitter {
6832
7005
  set mode(m) {
6833
7006
  if (this._mode === m) {
6834
7007
  return;
@@ -6840,18 +7013,19 @@ class DefaultTicker {
6840
7013
  return this._mode;
6841
7014
  }
6842
7015
  constructor(timelines = []) {
7016
+ super();
6843
7017
  this.handleTick = (handler, params) => {
6844
7018
  const { once = false } = params !== null && params !== void 0 ? params : {};
6845
7019
  if (this.ifCanStop()) {
6846
7020
  this.stop();
6847
7021
  return;
6848
7022
  }
6849
- this._handlerTick(handler);
7023
+ this._handlerTick();
6850
7024
  if (!once) {
6851
7025
  handler.tick(this.interval, this.handleTick);
6852
7026
  }
6853
7027
  };
6854
- this._handlerTick = (handler) => {
7028
+ this._handlerTick = () => {
6855
7029
  const tickerHandler = this.tickerHandler;
6856
7030
  const time = tickerHandler.getTime();
6857
7031
  let delta = 0;
@@ -6866,6 +7040,7 @@ class DefaultTicker {
6866
7040
  this.timelines.forEach(t => {
6867
7041
  t.tick(delta);
6868
7042
  });
7043
+ this.emit('afterTick');
6869
7044
  };
6870
7045
  this.init();
6871
7046
  this.lastFrameTime = -1;
@@ -7005,6 +7180,11 @@ class DefaultTicker {
7005
7180
  this.setupTickHandler();
7006
7181
  this.lastFrameTime = -1;
7007
7182
  }
7183
+ trySyncTickStatus() {
7184
+ if (this.status === STATUS$1.RUNNING) {
7185
+ this._handlerTick();
7186
+ }
7187
+ }
7008
7188
  }
7009
7189
 
7010
7190
  class ManualTickHandler {
@@ -8825,6 +9005,11 @@ class TagPointsUpdate extends ACustomAnimate {
8825
9005
  this.clipRange =
8826
9006
  this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /
8827
9007
  this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension];
9008
+ if (this.clipRange === 1) {
9009
+ this.shrinkClipRange =
9010
+ this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /
9011
+ this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension];
9012
+ }
8828
9013
  if (!isValidNumber(this.clipRange)) {
8829
9014
  this.clipRange = 0;
8830
9015
  }
@@ -8864,6 +9049,12 @@ class TagPointsUpdate extends ACustomAnimate {
8864
9049
  return newPoint;
8865
9050
  });
8866
9051
  }
9052
+ onFirstRun() {
9053
+ const lastClipRange = this.target.attribute.clipRange;
9054
+ if (isValidNumber(lastClipRange * this.clipRange)) {
9055
+ this.clipRange *= lastClipRange;
9056
+ }
9057
+ }
8867
9058
  onUpdate(end, ratio, out) {
8868
9059
  this.points = this.points.map((point, index) => {
8869
9060
  const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
@@ -8871,6 +9062,17 @@ class TagPointsUpdate extends ACustomAnimate {
8871
9062
  return newPoint;
8872
9063
  });
8873
9064
  if (this.clipRange) {
9065
+ if (this.shrinkClipRange) {
9066
+ if (!end) {
9067
+ out.points = this.fromPoints;
9068
+ out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio;
9069
+ }
9070
+ else {
9071
+ out.points = this.toPoints;
9072
+ out.clipRange = 1;
9073
+ }
9074
+ return;
9075
+ }
8874
9076
  out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
8875
9077
  }
8876
9078
  if (this.segmentsCache && this.to.segments) {
@@ -15396,14 +15598,14 @@ class DefaultArcRenderContribution {
15396
15598
  if (!(doOuterBorder || doInnerBorder)) {
15397
15599
  return;
15398
15600
  }
15399
- 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;
15601
+ 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;
15400
15602
  let { innerRadius = arcAttribute.innerRadius, outerRadius = arcAttribute.outerRadius } = arc.attribute;
15401
15603
  outerRadius += outerPadding;
15402
15604
  innerRadius -= innerPadding;
15403
15605
  const renderBorder = (borderStyle, key) => {
15404
15606
  const doStroke = !!(borderStyle && borderStyle.stroke);
15405
15607
  const { distance = arcAttribute[key].distance } = borderStyle;
15406
- const d = getScaledStroke(context, distance, context.dpr);
15608
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15407
15609
  const deltaAngle = distance / outerRadius;
15408
15610
  const sign = key === 'outerBorder' ? 1 : -1;
15409
15611
  arc.setAttributes({
@@ -15448,11 +15650,11 @@ class DefaultCircleRenderContribution {
15448
15650
  if (!(doOuterBorder || doInnerBorder)) {
15449
15651
  return;
15450
15652
  }
15451
- 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;
15653
+ 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;
15452
15654
  const renderBorder = (borderStyle, key) => {
15453
15655
  const doStroke = !!(borderStyle && borderStyle.stroke);
15454
15656
  const { distance = circleAttribute[key].distance } = borderStyle;
15455
- const d = getScaledStroke(context, distance, context.dpr);
15657
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15456
15658
  const sign = key === 'outerBorder' ? 1 : -1;
15457
15659
  context.beginPath();
15458
15660
  context.arc(x, y, radius + sign * d, startAngle, endAngle);
@@ -15637,7 +15839,7 @@ class DefaultRectRenderContribution {
15637
15839
  if (!(doOuterBorder || doInnerBorder)) {
15638
15840
  return;
15639
15841
  }
15640
- 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;
15842
+ 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;
15641
15843
  let { width, height } = rect.attribute;
15642
15844
  width = (width !== null && width !== void 0 ? width : x1 - x) || 0;
15643
15845
  height = (height !== null && height !== void 0 ? height : y1 - y) || 0;
@@ -15645,7 +15847,7 @@ class DefaultRectRenderContribution {
15645
15847
  const doStroke = !!(borderStyle && borderStyle.stroke);
15646
15848
  const sign = key === 'outerBorder' ? -1 : 1;
15647
15849
  const { distance = rectAttribute[key].distance } = borderStyle;
15648
- const d = getScaledStroke(context, distance, context.dpr);
15850
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15649
15851
  const nextX = x + sign * d;
15650
15852
  const nextY = y + sign * d;
15651
15853
  const dw = d * 2;
@@ -15885,11 +16087,11 @@ class DefaultSymbolRenderContribution {
15885
16087
  if (!(doOuterBorder || doInnerBorder)) {
15886
16088
  return;
15887
16089
  }
15888
- const { size = symbolAttribute.size, opacity = symbolAttribute.opacity, x: originX = symbolAttribute.x, y: originY = symbolAttribute.y, scaleX = symbolAttribute.scaleX, scaleY = symbolAttribute.scaleY } = symbol.attribute;
16090
+ 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;
15889
16091
  const renderBorder = (borderStyle, key) => {
15890
16092
  const doStroke = !!(borderStyle && borderStyle.stroke);
15891
16093
  const { distance = symbolAttribute[key].distance } = borderStyle;
15892
- const d = getScaledStroke(context, distance, context.dpr);
16094
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15893
16095
  const sign = key === 'outerBorder' ? 1 : -1;
15894
16096
  context.beginPath();
15895
16097
  if (parsedPath.drawOffset(context, size, x, y, sign * d) === false) {
@@ -16010,7 +16212,7 @@ let DefaultCanvasArcRender = class DefaultCanvasArcRender extends BaseRender {
16010
16212
  }
16011
16213
  drawShape(arc, context, x, y, drawContext, params, fillCb, strokeCb) {
16012
16214
  const arcAttribute = getTheme(arc, params === null || params === void 0 ? void 0 : params.theme).arc;
16013
- const { fill = arcAttribute.fill, stroke = arcAttribute.stroke, x: originX = arcAttribute.x, y: originY = arcAttribute.y } = arc.attribute;
16215
+ const { fill = arcAttribute.fill, stroke = arcAttribute.stroke, x: originX = arcAttribute.x, y: originY = arcAttribute.y, fillStrokeOrder = arcAttribute.fillStrokeOrder } = arc.attribute;
16014
16216
  const data = this.valid(arc, arcAttribute, fillCb, strokeCb);
16015
16217
  if (!data) {
16016
16218
  return;
@@ -16038,23 +16240,35 @@ let DefaultCanvasArcRender = class DefaultCanvasArcRender extends BaseRender {
16038
16240
  beforeRenderContribitionsRuned = true;
16039
16241
  context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);
16040
16242
  this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
16041
- if (doFill) {
16042
- if (fillCb) {
16043
- fillCb(context, arc.attribute, arcAttribute);
16243
+ const _runFill = () => {
16244
+ if (doFill) {
16245
+ if (fillCb) {
16246
+ fillCb(context, arc.attribute, arcAttribute);
16247
+ }
16248
+ else if (fVisible) {
16249
+ context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);
16250
+ context.fill();
16251
+ }
16044
16252
  }
16045
- else if (fVisible) {
16046
- context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);
16047
- context.fill();
16253
+ };
16254
+ const _runStroke = () => {
16255
+ if (doStroke && isFullStroke) {
16256
+ if (strokeCb) {
16257
+ strokeCb(context, arc.attribute, arcAttribute);
16258
+ }
16259
+ else if (sVisible) {
16260
+ context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);
16261
+ context.stroke();
16262
+ }
16048
16263
  }
16264
+ };
16265
+ if (!fillStrokeOrder) {
16266
+ _runFill();
16267
+ _runStroke();
16049
16268
  }
16050
- if (doStroke && isFullStroke) {
16051
- if (strokeCb) {
16052
- strokeCb(context, arc.attribute, arcAttribute);
16053
- }
16054
- else if (sVisible) {
16055
- context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute);
16056
- context.stroke();
16057
- }
16269
+ else {
16270
+ _runStroke();
16271
+ _runFill();
16058
16272
  }
16059
16273
  }
16060
16274
  if (!isFullStroke && doStroke) {
@@ -16084,24 +16298,36 @@ let DefaultCanvasArcRender = class DefaultCanvasArcRender extends BaseRender {
16084
16298
  if (!beforeRenderContribitionsRuned) {
16085
16299
  this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
16086
16300
  }
16087
- if (doFill) {
16088
- const color = fill;
16089
- if (color.gradient === 'conical') {
16090
- const lastColor = getConicGradientAt(0, 0, endAngle, color);
16091
- if (fillCb) ;
16092
- else if (fillVisible) {
16093
- context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute);
16094
- context.fillStyle = lastColor;
16095
- context.fill();
16301
+ const _runFill = () => {
16302
+ if (doFill) {
16303
+ const color = fill;
16304
+ if (color.gradient === 'conical') {
16305
+ const lastColor = getConicGradientAt(0, 0, endAngle, color);
16306
+ if (fillCb) ;
16307
+ else if (fillVisible) {
16308
+ context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute);
16309
+ context.fillStyle = lastColor;
16310
+ context.fill();
16311
+ }
16096
16312
  }
16097
16313
  }
16098
- }
16099
- if (doStroke) {
16100
- if (strokeCb) ;
16101
- else if (sVisible) {
16102
- context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute);
16103
- context.stroke();
16314
+ };
16315
+ const _runStroke = () => {
16316
+ if (doStroke) {
16317
+ if (strokeCb) ;
16318
+ else if (sVisible) {
16319
+ context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute);
16320
+ context.stroke();
16321
+ }
16104
16322
  }
16323
+ };
16324
+ if (!fillStrokeOrder) {
16325
+ _runFill();
16326
+ _runStroke();
16327
+ }
16328
+ else {
16329
+ _runFill();
16330
+ _runStroke();
16105
16331
  }
16106
16332
  }
16107
16333
  }
@@ -16137,7 +16363,7 @@ let DefaultCanvasCircleRender = class DefaultCanvasCircleRender extends BaseRend
16137
16363
  }
16138
16364
  drawShape(circle, context, x, y, drawContext, params, fillCb, strokeCb) {
16139
16365
  const circleAttribute = getTheme(circle, params === null || params === void 0 ? void 0 : params.theme).circle;
16140
- const { radius = circleAttribute.radius, startAngle = circleAttribute.startAngle, endAngle = circleAttribute.endAngle, x: originX = circleAttribute.x, y: originY = circleAttribute.y } = circle.attribute;
16366
+ const { radius = circleAttribute.radius, startAngle = circleAttribute.startAngle, endAngle = circleAttribute.endAngle, x: originX = circleAttribute.x, y: originY = circleAttribute.y, fillStrokeOrder = circleAttribute.fillStrokeOrder } = circle.attribute;
16141
16367
  const data = this.valid(circle, circleAttribute, fillCb, strokeCb);
16142
16368
  if (!data) {
16143
16369
  return;
@@ -16148,23 +16374,35 @@ let DefaultCanvasCircleRender = class DefaultCanvasCircleRender extends BaseRend
16148
16374
  context.closePath();
16149
16375
  context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);
16150
16376
  this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
16151
- if (doFill) {
16152
- if (fillCb) {
16153
- fillCb(context, circle.attribute, circleAttribute);
16377
+ const _runFill = () => {
16378
+ if (doFill) {
16379
+ if (fillCb) {
16380
+ fillCb(context, circle.attribute, circleAttribute);
16381
+ }
16382
+ else if (fVisible) {
16383
+ context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);
16384
+ context.fill();
16385
+ }
16154
16386
  }
16155
- else if (fVisible) {
16156
- context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);
16157
- context.fill();
16387
+ };
16388
+ const _runStroke = () => {
16389
+ if (doStroke) {
16390
+ if (strokeCb) {
16391
+ strokeCb(context, circle.attribute, circleAttribute);
16392
+ }
16393
+ else if (sVisible) {
16394
+ context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);
16395
+ context.stroke();
16396
+ }
16158
16397
  }
16398
+ };
16399
+ if (!fillStrokeOrder) {
16400
+ _runFill();
16401
+ _runStroke();
16159
16402
  }
16160
- if (doStroke) {
16161
- if (strokeCb) {
16162
- strokeCb(context, circle.attribute, circleAttribute);
16163
- }
16164
- else if (sVisible) {
16165
- context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);
16166
- context.stroke();
16167
- }
16403
+ else {
16404
+ _runStroke();
16405
+ _runFill();
16168
16406
  }
16169
16407
  this.afterRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
16170
16408
  }
@@ -16922,7 +17160,7 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
16922
17160
  this.init(areaRenderContribitions);
16923
17161
  }
16924
17162
  drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
16925
- var _a, _b, _c, _d, _e;
17163
+ var _a, _b, _c;
16926
17164
  const { points } = area.attribute;
16927
17165
  if (points.length < 2) {
16928
17166
  return;
@@ -16943,44 +17181,51 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
16943
17181
  context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute);
16944
17182
  this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, areaAttribute, drawContext, fillCb, null, { attribute: area.attribute });
16945
17183
  const { x: originX = 0, x: originY = 0 } = area.attribute;
16946
- if (fill !== false) {
16947
- if (fillCb) {
16948
- fillCb(context, area.attribute, areaAttribute);
16949
- }
16950
- else if (fillOpacity) {
16951
- context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);
16952
- context.fill();
17184
+ const _runFill = () => {
17185
+ if (fill !== false) {
17186
+ if (fillCb) {
17187
+ fillCb(context, area.attribute, areaAttribute);
17188
+ }
17189
+ else if (fillOpacity) {
17190
+ context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);
17191
+ context.fill();
17192
+ }
16953
17193
  }
16954
- }
16955
- this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, areaAttribute, drawContext, fillCb, null, { attribute: area.attribute });
16956
- if (stroke) {
16957
- const { stroke = areaAttribute && areaAttribute.stroke } = area.attribute;
16958
- if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {
16959
- context.beginPath();
16960
- if (stroke[0]) {
16961
- context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
16962
- for (let i = 1; i < points.length; i++) {
16963
- const p = points[i];
16964
- context.lineTo(p.x + offsetX, p.y + offsetY, z);
17194
+ };
17195
+ const _runStroke = () => {
17196
+ var _a, _b;
17197
+ if (stroke) {
17198
+ const { stroke = areaAttribute && areaAttribute.stroke } = area.attribute;
17199
+ if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {
17200
+ context.beginPath();
17201
+ if (stroke[0]) {
17202
+ context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
17203
+ for (let i = 1; i < points.length; i++) {
17204
+ const p = points[i];
17205
+ context.lineTo(p.x + offsetX, p.y + offsetY, z);
17206
+ }
16965
17207
  }
16966
- }
16967
- else if (stroke[2]) {
16968
- const endP = points[points.length - 1];
16969
- context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
16970
- for (let i = points.length - 2; i >= 0; i--) {
16971
- const p = points[i];
16972
- context.lineTo(((_d = p.x1) !== null && _d !== void 0 ? _d : p.x) + offsetX, ((_e = p.y1) !== null && _e !== void 0 ? _e : p.y) + offsetY, z);
17208
+ else if (stroke[2]) {
17209
+ const endP = points[points.length - 1];
17210
+ context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
17211
+ for (let i = points.length - 2; i >= 0; i--) {
17212
+ const p = points[i];
17213
+ context.lineTo(((_a = p.x1) !== null && _a !== void 0 ? _a : p.x) + offsetX, ((_b = p.y1) !== null && _b !== void 0 ? _b : p.y) + offsetY, z);
17214
+ }
16973
17215
  }
16974
17216
  }
17217
+ if (strokeCb) {
17218
+ strokeCb(context, area.attribute, areaAttribute);
17219
+ }
17220
+ else {
17221
+ context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);
17222
+ context.stroke();
17223
+ }
16975
17224
  }
16976
- if (strokeCb) {
16977
- strokeCb(context, area.attribute, areaAttribute);
16978
- }
16979
- else {
16980
- context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute);
16981
- context.stroke();
16982
- }
16983
- }
17225
+ };
17226
+ _runFill();
17227
+ this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, areaAttribute, drawContext, fillCb, null, { attribute: area.attribute });
17228
+ _runStroke();
16984
17229
  }
16985
17230
  drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
16986
17231
  var _a, _b, _c, _d, _e, _f;
@@ -17210,38 +17455,44 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
17210
17455
  this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, defaultAttribute, drawContext, fillCb, null, { attribute });
17211
17456
  context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
17212
17457
  const { x: originX = 0, x: originY = 0 } = attribute;
17213
- if (fill !== false) {
17214
- if (fillCb) {
17215
- fillCb(context, attribute, defaultAttribute);
17216
- }
17217
- else if (fillOpacity) {
17218
- context.setCommonStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute);
17219
- context.fill();
17220
- }
17221
- }
17222
- this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, defaultAttribute, drawContext, fillCb, null, { attribute });
17223
- if (stroke !== false) {
17224
- if (strokeCb) {
17225
- strokeCb(context, attribute, defaultAttribute);
17458
+ const _runFill = () => {
17459
+ if (fill !== false) {
17460
+ if (fillCb) {
17461
+ fillCb(context, attribute, defaultAttribute);
17462
+ }
17463
+ else if (fillOpacity) {
17464
+ context.setCommonStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute);
17465
+ context.fill();
17466
+ }
17226
17467
  }
17227
- else {
17228
- const { stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke } = attribute;
17229
- if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {
17230
- context.beginPath();
17231
- drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? 'x' : 'y', {
17232
- offsetX,
17233
- offsetY,
17234
- offsetZ,
17235
- drawConnect: connect,
17236
- mode: connectedType,
17237
- zeroX: connectedX,
17238
- zeroY: connectedY
17239
- });
17468
+ };
17469
+ const _runStroke = () => {
17470
+ if (stroke !== false) {
17471
+ if (strokeCb) {
17472
+ strokeCb(context, attribute, defaultAttribute);
17473
+ }
17474
+ else {
17475
+ const { stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke } = attribute;
17476
+ if (isArray(stroke) && (stroke[0] || stroke[2]) && stroke[1] === false) {
17477
+ context.beginPath();
17478
+ drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? 'x' : 'y', {
17479
+ offsetX,
17480
+ offsetY,
17481
+ offsetZ,
17482
+ drawConnect: connect,
17483
+ mode: connectedType,
17484
+ zeroX: connectedX,
17485
+ zeroY: connectedY
17486
+ });
17487
+ }
17488
+ context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute);
17489
+ context.stroke();
17240
17490
  }
17241
- context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute);
17242
- context.stroke();
17243
17491
  }
17244
- }
17492
+ };
17493
+ _runFill();
17494
+ this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, false, fill, false, defaultAttribute, drawContext, fillCb, null, { attribute });
17495
+ _runStroke();
17245
17496
  return ret;
17246
17497
  }
17247
17498
  };
@@ -17266,7 +17517,7 @@ let DefaultCanvasPathRender = class DefaultCanvasPathRender extends BaseRender {
17266
17517
  drawShape(path, context, x, y, drawContext, params, fillCb, strokeCb) {
17267
17518
  var _a, _b, _c;
17268
17519
  const pathAttribute = (_a = this.tempTheme) !== null && _a !== void 0 ? _a : getTheme(path, params === null || params === void 0 ? void 0 : params.theme).path;
17269
- const { x: originX = pathAttribute.x, y: originY = pathAttribute.y } = path.attribute;
17520
+ const { x: originX = pathAttribute.x, y: originY = pathAttribute.y, fillStrokeOrder = pathAttribute.fillStrokeOrder } = path.attribute;
17270
17521
  const z = (_b = this.z) !== null && _b !== void 0 ? _b : 0;
17271
17522
  const data = this.valid(path, pathAttribute, fillCb, strokeCb);
17272
17523
  if (!data) {
@@ -17283,23 +17534,35 @@ let DefaultCanvasPathRender = class DefaultCanvasPathRender extends BaseRender {
17283
17534
  }
17284
17535
  context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute);
17285
17536
  this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
17286
- if (doStroke) {
17287
- if (strokeCb) {
17288
- strokeCb(context, path.attribute, pathAttribute);
17537
+ const _runStroke = () => {
17538
+ if (doStroke) {
17539
+ if (strokeCb) {
17540
+ strokeCb(context, path.attribute, pathAttribute);
17541
+ }
17542
+ else if (sVisible) {
17543
+ context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute);
17544
+ context.stroke();
17545
+ }
17289
17546
  }
17290
- else if (sVisible) {
17291
- context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute);
17292
- context.stroke();
17547
+ };
17548
+ const _runFill = () => {
17549
+ if (doFill) {
17550
+ if (fillCb) {
17551
+ fillCb(context, path.attribute, pathAttribute);
17552
+ }
17553
+ else if (fVisible) {
17554
+ context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute);
17555
+ context.fill();
17556
+ }
17293
17557
  }
17558
+ };
17559
+ if (!fillStrokeOrder) {
17560
+ _runFill();
17561
+ _runStroke();
17294
17562
  }
17295
- if (doFill) {
17296
- if (fillCb) {
17297
- fillCb(context, path.attribute, pathAttribute);
17298
- }
17299
- else if (fVisible) {
17300
- context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute);
17301
- context.fill();
17302
- }
17563
+ else {
17564
+ _runStroke();
17565
+ _runFill();
17303
17566
  }
17304
17567
  this.afterRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
17305
17568
  }
@@ -17333,7 +17596,7 @@ let DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
17333
17596
  drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
17334
17597
  var _a;
17335
17598
  const rectAttribute = (_a = this.tempTheme) !== null && _a !== void 0 ? _a : getTheme(rect, params === null || params === void 0 ? void 0 : params.theme).rect;
17336
- const { fill = rectAttribute.fill, background, stroke = rectAttribute.stroke, cornerRadius = rectAttribute.cornerRadius, opacity = rectAttribute.opacity, fillOpacity = rectAttribute.fillOpacity, lineWidth = rectAttribute.lineWidth, strokeOpacity = rectAttribute.strokeOpacity, visible = rectAttribute.visible, x1, y1, x: originX = rectAttribute.x, y: originY = rectAttribute.y } = rect.attribute;
17599
+ const { fill = rectAttribute.fill, background, stroke = rectAttribute.stroke, cornerRadius = rectAttribute.cornerRadius, opacity = rectAttribute.opacity, fillOpacity = rectAttribute.fillOpacity, lineWidth = rectAttribute.lineWidth, strokeOpacity = rectAttribute.strokeOpacity, visible = rectAttribute.visible, x1, y1, x: originX = rectAttribute.x, y: originY = rectAttribute.y, fillStrokeOrder = rectAttribute.fillStrokeOrder } = rect.attribute;
17337
17600
  let { width, height } = rect.attribute;
17338
17601
  width = (width !== null && width !== void 0 ? width : x1 - originX) || 0;
17339
17602
  height = (height !== null && height !== void 0 ? height : y1 - originY) || 0;
@@ -17364,23 +17627,35 @@ let DefaultCanvasRectRender = class DefaultCanvasRectRender extends BaseRender {
17364
17627
  };
17365
17628
  context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);
17366
17629
  this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
17367
- if (doFillOrStroke.doFill) {
17368
- if (fillCb) {
17369
- fillCb(context, rect.attribute, rectAttribute);
17630
+ const _runFill = () => {
17631
+ if (doFillOrStroke.doFill) {
17632
+ if (fillCb) {
17633
+ fillCb(context, rect.attribute, rectAttribute);
17634
+ }
17635
+ else if (fVisible) {
17636
+ context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);
17637
+ context.fill();
17638
+ }
17370
17639
  }
17371
- else if (fVisible) {
17372
- context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);
17373
- context.fill();
17640
+ };
17641
+ const _runStroke = () => {
17642
+ if (doFillOrStroke.doStroke) {
17643
+ if (strokeCb) {
17644
+ strokeCb(context, rect.attribute, rectAttribute);
17645
+ }
17646
+ else if (sVisible) {
17647
+ context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);
17648
+ context.stroke();
17649
+ }
17374
17650
  }
17651
+ };
17652
+ if (!fillStrokeOrder) {
17653
+ _runFill();
17654
+ _runStroke();
17375
17655
  }
17376
- if (doFillOrStroke.doStroke) {
17377
- if (strokeCb) {
17378
- strokeCb(context, rect.attribute, rectAttribute);
17379
- }
17380
- else if (sVisible) {
17381
- context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);
17382
- context.stroke();
17383
- }
17656
+ else {
17657
+ _runStroke();
17658
+ _runFill();
17384
17659
  }
17385
17660
  this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
17386
17661
  }
@@ -17413,7 +17688,7 @@ let DefaultCanvasSymbolRender = class DefaultCanvasSymbolRender extends BaseRend
17413
17688
  drawShape(symbol, context, x, y, drawContext, params, fillCb, strokeCb) {
17414
17689
  var _a;
17415
17690
  const symbolAttribute = getTheme(symbol, params === null || params === void 0 ? void 0 : params.theme).symbol;
17416
- const { size = symbolAttribute.size, x: originX = symbolAttribute.x, y: originY = symbolAttribute.y, scaleX = symbolAttribute.scaleX, scaleY = symbolAttribute.scaleY } = symbol.attribute;
17691
+ const { size = symbolAttribute.size, x: originX = symbolAttribute.x, y: originY = symbolAttribute.y, scaleX = symbolAttribute.scaleX, scaleY = symbolAttribute.scaleY, fillStrokeOrder = symbolAttribute.fillStrokeOrder } = symbol.attribute;
17417
17692
  const data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);
17418
17693
  if (!data) {
17419
17694
  return;
@@ -17436,23 +17711,35 @@ let DefaultCanvasSymbolRender = class DefaultCanvasSymbolRender extends BaseRend
17436
17711
  obj.stroke = (_c = a.stroke) !== null && _c !== void 0 ? _c : symbol.attribute.stroke;
17437
17712
  a = obj;
17438
17713
  }
17439
- if (a.fill) {
17440
- if (fillCb) {
17441
- fillCb(context, symbol.attribute, symbolAttribute);
17714
+ const _runFill = () => {
17715
+ if (a.fill) {
17716
+ if (fillCb) {
17717
+ fillCb(context, symbol.attribute, symbolAttribute);
17718
+ }
17719
+ else {
17720
+ context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);
17721
+ context.fill();
17722
+ }
17442
17723
  }
17443
- else {
17444
- context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);
17445
- context.fill();
17724
+ };
17725
+ const _runStroke = () => {
17726
+ if (a.stroke) {
17727
+ if (strokeCb) {
17728
+ strokeCb(context, symbol.attribute, symbolAttribute);
17729
+ }
17730
+ else {
17731
+ context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);
17732
+ context.stroke();
17733
+ }
17446
17734
  }
17735
+ };
17736
+ if (!fillStrokeOrder) {
17737
+ _runFill();
17738
+ _runStroke();
17447
17739
  }
17448
- if (a.stroke) {
17449
- if (strokeCb) {
17450
- strokeCb(context, symbol.attribute, symbolAttribute);
17451
- }
17452
- else {
17453
- context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);
17454
- context.stroke();
17455
- }
17740
+ else {
17741
+ _runStroke();
17742
+ _runFill();
17456
17743
  }
17457
17744
  };
17458
17745
  if (keepDirIn3d && context.camera && context.project) {
@@ -17471,23 +17758,35 @@ let DefaultCanvasSymbolRender = class DefaultCanvasSymbolRender extends BaseRend
17471
17758
  }
17472
17759
  context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);
17473
17760
  this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
17474
- if (doFill && !parsedPath.isSvg) {
17475
- if (fillCb) {
17476
- fillCb(context, symbol.attribute, symbolAttribute);
17761
+ const _runFill = () => {
17762
+ if (doFill && !parsedPath.isSvg) {
17763
+ if (fillCb) {
17764
+ fillCb(context, symbol.attribute, symbolAttribute);
17765
+ }
17766
+ else if (fVisible) {
17767
+ context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute);
17768
+ context.fill();
17769
+ }
17477
17770
  }
17478
- else if (fVisible) {
17479
- context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute);
17480
- context.fill();
17771
+ };
17772
+ const _runStroke = () => {
17773
+ if (doStroke && !parsedPath.isSvg) {
17774
+ if (strokeCb) {
17775
+ strokeCb(context, symbol.attribute, symbolAttribute);
17776
+ }
17777
+ else if (sVisible) {
17778
+ context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);
17779
+ context.stroke();
17780
+ }
17481
17781
  }
17782
+ };
17783
+ if (!fillStrokeOrder) {
17784
+ _runFill();
17785
+ _runStroke();
17482
17786
  }
17483
- if (doStroke && !parsedPath.isSvg) {
17484
- if (strokeCb) {
17485
- strokeCb(context, symbol.attribute, symbolAttribute);
17486
- }
17487
- else if (sVisible) {
17488
- context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);
17489
- context.stroke();
17490
- }
17787
+ else {
17788
+ _runStroke();
17789
+ _runFill();
17491
17790
  }
17492
17791
  this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
17493
17792
  }
@@ -17681,13 +17980,7 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17681
17980
  var _a, _b, _c;
17682
17981
  const textAttribute = getTheme(text, params === null || params === void 0 ? void 0 : params.theme).text;
17683
17982
  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;
17684
- let { textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline } = text.attribute;
17685
- if (!verticalMode && direction === 'vertical') {
17686
- const t = textAlign;
17687
- textAlign = (_a = text.getBaselineMapAlign()[textBaseline]) !== null && _a !== void 0 ? _a : 'left';
17688
- textBaseline = (_b = text.getAlignMapBaseline()[t]) !== null && _b !== void 0 ? _b : 'top';
17689
- }
17690
- const lineHeight = (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) !== null && _c !== void 0 ? _c : fontSize;
17983
+ const lineHeight = (_a = calculateLineHeight(text.attribute.lineHeight, fontSize)) !== null && _a !== void 0 ? _a : fontSize;
17691
17984
  const data = this.valid(text, textAttribute, fillCb, strokeCb);
17692
17985
  if (!data) {
17693
17986
  return;
@@ -17726,7 +18019,6 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17726
18019
  else if (fVisible) {
17727
18020
  context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
17728
18021
  context.fillText(t, _x, _y, z);
17729
- this.drawUnderLine(underline, lineThrough, text, _x, _y, z, textAttribute, context);
17730
18022
  }
17731
18023
  }
17732
18024
  if (direction) {
@@ -17734,132 +18026,88 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17734
18026
  context.setTransformForCurrent();
17735
18027
  }
17736
18028
  };
17737
- if (text.isMultiLine) {
17738
- context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
17739
- if (direction === 'horizontal') {
17740
- const { multilineLayout } = text;
17741
- if (!multilineLayout) {
17742
- context.highPerformanceRestore();
17743
- return;
17744
- }
17745
- const { xOffset, yOffset } = multilineLayout.bbox;
17746
- if (doStroke) {
17747
- if (strokeCb) {
17748
- strokeCb(context, text.attribute, textAttribute);
17749
- }
17750
- else if (sVisible) {
17751
- context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute);
17752
- multilineLayout.lines.forEach(line => {
17753
- context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
17754
- });
17755
- }
17756
- }
17757
- if (doFill) {
17758
- if (fillCb) {
17759
- fillCb(context, text.attribute, textAttribute);
17760
- }
17761
- else if (fVisible) {
17762
- context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
17763
- multilineLayout.lines.forEach(line => {
17764
- context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
17765
- this.drawUnderLine(underline, lineThrough, text, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y - textDrawOffsetY('bottom', fontSize) - 0.05 * fontSize, z, textAttribute, context, {
17766
- width: line.width
17767
- });
17768
- });
17769
- }
17770
- }
18029
+ context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
18030
+ if (direction === 'horizontal') {
18031
+ const { multilineLayout } = text;
18032
+ if (!multilineLayout) {
18033
+ context.highPerformanceRestore();
18034
+ return;
17771
18035
  }
17772
- else {
17773
- text.tryUpdateAABBBounds();
17774
- const cache = text.cache;
17775
- const { verticalList } = cache;
17776
- context.textAlign = 'left';
17777
- context.textBaseline = 'top';
17778
- const totalHeight = lineHeight * verticalList.length;
17779
- let totalW = 0;
17780
- verticalList.forEach(verticalData => {
17781
- const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
17782
- totalW = max(_w, totalW);
17783
- });
17784
- let offsetY = 0;
17785
- let offsetX = 0;
17786
- if (textBaseline === 'bottom') {
17787
- offsetX = -totalHeight;
18036
+ const { xOffset, yOffset } = multilineLayout.bbox;
18037
+ if (doStroke) {
18038
+ if (strokeCb) {
18039
+ strokeCb(context, text.attribute, textAttribute);
17788
18040
  }
17789
- else if (textBaseline === 'middle') {
17790
- offsetX = -totalHeight / 2;
18041
+ else if (sVisible) {
18042
+ context.setStrokeStyle(text, text.attribute, originX - x, originY - y, textAttribute);
18043
+ multilineLayout.lines.forEach(line => {
18044
+ context.strokeText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
18045
+ });
17791
18046
  }
17792
- if (textAlign === 'center') {
17793
- offsetY -= totalW / 2;
18047
+ }
18048
+ if (doFill) {
18049
+ if (fillCb) {
18050
+ fillCb(context, text.attribute, textAttribute);
17794
18051
  }
17795
- else if (textAlign === 'right') {
17796
- offsetY -= totalW;
17797
- }
17798
- verticalList.forEach((verticalData, i) => {
17799
- const currentW = verticalData.reduce((a, b) => a + (b.width || 0), 0);
17800
- const dw = totalW - currentW;
17801
- let currentOffsetY = offsetY;
17802
- if (textAlign === 'center') {
17803
- currentOffsetY += dw / 2;
17804
- }
17805
- else if (textAlign === 'right') {
17806
- currentOffsetY += dw;
17807
- }
17808
- verticalData.forEach(item => {
17809
- const { text, width, direction } = item;
17810
- drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction);
17811
- currentOffsetY += width;
18052
+ else if (fVisible) {
18053
+ context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
18054
+ multilineLayout.lines.forEach(line => {
18055
+ context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
18056
+ 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, {
18057
+ width: line.width
18058
+ });
17812
18059
  });
17813
- });
18060
+ }
17814
18061
  }
17815
18062
  }
17816
18063
  else {
17817
- if (direction === 'horizontal') {
17818
- context.setTextStyle(text.attribute, textAttribute, z);
17819
- const t = text.clipedText;
17820
- let dy = 0;
17821
- if (lineHeight !== fontSize) {
17822
- if (textBaseline === 'top') {
17823
- dy = (lineHeight - fontSize) / 2;
17824
- }
17825
- else if (textBaseline === 'middle') ;
17826
- else if (textBaseline === 'bottom') {
17827
- dy = -(lineHeight - fontSize) / 2;
17828
- }
17829
- else ;
17830
- }
17831
- drawText(t, 0, dy, 0);
18064
+ let { textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline } = text.attribute;
18065
+ if (!verticalMode) {
18066
+ const t = textAlign;
18067
+ textAlign = (_b = text.getBaselineMapAlign()[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
18068
+ textBaseline = (_c = text.getAlignMapBaseline()[t]) !== null && _c !== void 0 ? _c : 'top';
18069
+ }
18070
+ text.tryUpdateAABBBounds();
18071
+ const cache = text.cache;
18072
+ const { verticalList } = cache;
18073
+ context.textAlign = 'left';
18074
+ context.textBaseline = 'top';
18075
+ const totalHeight = lineHeight * verticalList.length;
18076
+ let totalW = 0;
18077
+ verticalList.forEach(verticalData => {
18078
+ const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
18079
+ totalW = max(_w, totalW);
18080
+ });
18081
+ let offsetY = 0;
18082
+ let offsetX = 0;
18083
+ if (textBaseline === 'bottom') {
18084
+ offsetX = -totalHeight;
17832
18085
  }
17833
- else {
17834
- text.tryUpdateAABBBounds();
17835
- const cache = text.cache;
17836
- if (cache) {
17837
- context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
17838
- const { verticalList } = cache;
17839
- let offsetY = 0;
17840
- const totalW = verticalList[0].reduce((a, b) => a + (b.width || 0), 0);
17841
- let offsetX = 0;
17842
- if (textBaseline === 'bottom') {
17843
- offsetX = -lineHeight;
17844
- }
17845
- else if (textBaseline === 'middle') {
17846
- offsetX = -lineHeight / 2;
17847
- }
17848
- if (textAlign === 'center') {
17849
- offsetY -= totalW / 2;
17850
- }
17851
- else if (textAlign === 'right') {
17852
- offsetY -= totalW;
17853
- }
17854
- context.textAlign = 'left';
17855
- context.textBaseline = 'top';
17856
- verticalList[0].forEach(item => {
17857
- const { text, width, direction } = item;
17858
- drawText(text, offsetX, offsetY, direction);
17859
- offsetY += width;
17860
- });
17861
- }
18086
+ else if (textBaseline === 'middle') {
18087
+ offsetX = -totalHeight / 2;
17862
18088
  }
18089
+ if (textAlign === 'center') {
18090
+ offsetY -= totalW / 2;
18091
+ }
18092
+ else if (textAlign === 'right') {
18093
+ offsetY -= totalW;
18094
+ }
18095
+ verticalList.forEach((verticalData, i) => {
18096
+ const currentW = verticalData.reduce((a, b) => a + (b.width || 0), 0);
18097
+ const dw = totalW - currentW;
18098
+ let currentOffsetY = offsetY;
18099
+ if (textAlign === 'center') {
18100
+ currentOffsetY += dw / 2;
18101
+ }
18102
+ else if (textAlign === 'right') {
18103
+ currentOffsetY += dw;
18104
+ }
18105
+ verticalData.forEach(item => {
18106
+ const { text, width, direction } = item;
18107
+ drawText(text, totalHeight - (i + 1) * lineHeight + offsetX, currentOffsetY, direction);
18108
+ currentOffsetY += width;
18109
+ });
18110
+ });
17863
18111
  }
17864
18112
  transform3dMatrixToContextMatrix && this.restoreTransformUseContext2d(text, textAttribute, z, context);
17865
18113
  this.afterRenderStep(text, context, x, y, doFill, doStroke, fVisible, sVisible, textAttribute, drawContext, fillCb, strokeCb);
@@ -17870,37 +18118,32 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17870
18118
  const computed3dMatrix = !keepDirIn3d;
17871
18119
  this._draw(text, textAttribute, computed3dMatrix, drawContext, params);
17872
18120
  }
17873
- drawUnderLine(underline, lineThrough, text, x, y, z, textAttribute, context, multiOption) {
18121
+ drawUnderLine(underline, lineThrough, text, anchorX, anchorY, offsetUnderLineY, offsetThroughLineY, z, textAttribute, context, multiOption) {
17874
18122
  if (lineThrough + underline <= 0) {
17875
18123
  return;
17876
18124
  }
17877
- 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;
18125
+ const { textAlign = textAttribute.textAlign, fill = textAttribute.fill, opacity = textAttribute.opacity, underlineOffset = textAttribute.underlineOffset, underlineDash = textAttribute.underlineDash, fillOpacity = textAttribute.fillOpacity } = text.attribute;
17878
18126
  const isMulti = !isNil(multiOption);
17879
18127
  const w = isMulti ? multiOption.width : text.clipedWidth;
17880
18128
  const offsetX = isMulti ? 0 : textDrawOffsetX(textAlign, w);
17881
- const offsetY = textLayoutOffsetY(isMulti ? 'alphabetic' : textBaseline, fontSize, fontSize);
17882
18129
  const attribute = { lineWidth: 0, stroke: fill, opacity, strokeOpacity: fillOpacity };
17883
- let deltaY = isMulti ? -3 : 0;
17884
18130
  if (underline) {
17885
18131
  attribute.lineWidth = underline;
17886
- context.setStrokeStyle(text, attribute, x, y, textAttribute);
18132
+ context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute);
17887
18133
  underlineDash && context.setLineDash(underlineDash);
17888
18134
  context.beginPath();
17889
- const dy = y + offsetY + fontSize + underlineOffset + deltaY;
17890
- context.moveTo(x + offsetX, dy, z);
17891
- context.lineTo(x + offsetX + w, dy, z);
18135
+ const dy = anchorY + offsetUnderLineY + underlineOffset;
18136
+ context.moveTo(anchorX + offsetX, dy, z);
18137
+ context.lineTo(anchorX + offsetX + w, dy, z);
17892
18138
  context.stroke();
17893
18139
  }
17894
- if (isMulti) {
17895
- deltaY = -1;
17896
- }
17897
18140
  if (lineThrough) {
17898
18141
  attribute.lineWidth = lineThrough;
17899
- context.setStrokeStyle(text, attribute, x, y, textAttribute);
18142
+ context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute);
17900
18143
  context.beginPath();
17901
- const dy = y + offsetY + fontSize / 2 + deltaY;
17902
- context.moveTo(x + offsetX, dy, z);
17903
- context.lineTo(x + offsetX + w, dy, z);
18144
+ const dy = anchorY + offsetThroughLineY;
18145
+ context.moveTo(anchorX + offsetX, dy, z);
18146
+ context.lineTo(anchorX + offsetX + w, dy, z);
17904
18147
  context.stroke();
17905
18148
  }
17906
18149
  }
@@ -18012,7 +18255,7 @@ let DefaultCanvasPolygonRender = class DefaultCanvasPolygonRender extends BaseRe
18012
18255
  }
18013
18256
  drawShape(polygon, context, x, y, drawContext, params, fillCb, strokeCb) {
18014
18257
  const polygonAttribute = getTheme(polygon, params === null || params === void 0 ? void 0 : params.theme).polygon;
18015
- const { points = polygonAttribute.points, cornerRadius = polygonAttribute.cornerRadius, x: originX = polygonAttribute.x, y: originY = polygonAttribute.y, closePath = polygonAttribute.closePath } = polygon.attribute;
18258
+ const { points = polygonAttribute.points, cornerRadius = polygonAttribute.cornerRadius, x: originX = polygonAttribute.x, y: originY = polygonAttribute.y, closePath = polygonAttribute.closePath, fillStrokeOrder = polygonAttribute.fillStrokeOrder } = polygon.attribute;
18016
18259
  const data = this.valid(polygon, polygonAttribute, fillCb, strokeCb);
18017
18260
  if (!data) {
18018
18261
  return;
@@ -18028,23 +18271,35 @@ let DefaultCanvasPolygonRender = class DefaultCanvasPolygonRender extends BaseRe
18028
18271
  closePath && context.closePath();
18029
18272
  context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute);
18030
18273
  this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
18031
- if (doFill) {
18032
- if (fillCb) {
18033
- fillCb(context, polygon.attribute, polygonAttribute);
18274
+ const _runFill = () => {
18275
+ if (doFill) {
18276
+ if (fillCb) {
18277
+ fillCb(context, polygon.attribute, polygonAttribute);
18278
+ }
18279
+ else if (fVisible) {
18280
+ context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);
18281
+ context.fill();
18282
+ }
18034
18283
  }
18035
- else if (fVisible) {
18036
- context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);
18037
- context.fill();
18284
+ };
18285
+ const _runStroke = () => {
18286
+ if (doStroke) {
18287
+ if (strokeCb) {
18288
+ strokeCb(context, polygon.attribute, polygonAttribute);
18289
+ }
18290
+ else if (sVisible) {
18291
+ context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);
18292
+ context.stroke();
18293
+ }
18038
18294
  }
18295
+ };
18296
+ if (!fillStrokeOrder) {
18297
+ _runFill();
18298
+ _runStroke();
18039
18299
  }
18040
- if (doStroke) {
18041
- if (strokeCb) {
18042
- strokeCb(context, polygon.attribute, polygonAttribute);
18043
- }
18044
- else if (sVisible) {
18045
- context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);
18046
- context.stroke();
18047
- }
18300
+ else {
18301
+ _runStroke();
18302
+ _runFill();
18048
18303
  }
18049
18304
  this.afterRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
18050
18305
  }
@@ -18067,7 +18322,7 @@ let DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
18067
18322
  }
18068
18323
  drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
18069
18324
  const groupAttribute = getTheme(group, params === null || params === void 0 ? void 0 : params.theme).group;
18070
- const { fill = groupAttribute.fill, background, stroke = groupAttribute.stroke, opacity = groupAttribute.opacity, width = groupAttribute.width, height = groupAttribute.height, clip = groupAttribute.clip, fillOpacity = groupAttribute.fillOpacity, strokeOpacity = groupAttribute.strokeOpacity, cornerRadius = groupAttribute.cornerRadius, path = groupAttribute.path, lineWidth = groupAttribute.lineWidth, visible = groupAttribute.visible } = group.attribute;
18325
+ const { fill = groupAttribute.fill, background, stroke = groupAttribute.stroke, opacity = groupAttribute.opacity, width = groupAttribute.width, height = groupAttribute.height, clip = groupAttribute.clip, fillOpacity = groupAttribute.fillOpacity, strokeOpacity = groupAttribute.strokeOpacity, cornerRadius = groupAttribute.cornerRadius, path = groupAttribute.path, lineWidth = groupAttribute.lineWidth, visible = groupAttribute.visible, fillStrokeOrder = groupAttribute.fillStrokeOrder, x: originX = groupAttribute.x, y: originY = groupAttribute.y } = group.attribute;
18071
18326
  const fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill);
18072
18327
  const sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height);
18073
18328
  const doFill = runFill(fill, background);
@@ -18123,23 +18378,35 @@ let DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
18123
18378
  context.clip();
18124
18379
  }
18125
18380
  context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);
18126
- if (doFillOrStroke.doFill) {
18127
- if (fillCb) {
18128
- fillCb(context, group.attribute, groupAttribute);
18381
+ const _runFill = () => {
18382
+ if (doFillOrStroke.doFill) {
18383
+ if (fillCb) {
18384
+ fillCb(context, group.attribute, groupAttribute);
18385
+ }
18386
+ else if (fVisible) {
18387
+ context.setCommonStyle(group, group.attribute, originX - x, originY - y, groupAttribute);
18388
+ context.fill();
18389
+ }
18129
18390
  }
18130
- else if (fVisible) {
18131
- context.setCommonStyle(group, group.attribute, x, y, groupAttribute);
18132
- context.fill();
18391
+ };
18392
+ const _runStroke = () => {
18393
+ if (doFillOrStroke.doStroke) {
18394
+ if (strokeCb) {
18395
+ strokeCb(context, group.attribute, groupAttribute);
18396
+ }
18397
+ else if (sVisible) {
18398
+ context.setStrokeStyle(group, group.attribute, originX - x, originY - y, groupAttribute);
18399
+ context.stroke();
18400
+ }
18133
18401
  }
18402
+ };
18403
+ if (!fillStrokeOrder) {
18404
+ _runFill();
18405
+ _runStroke();
18134
18406
  }
18135
- if (doFillOrStroke.doStroke) {
18136
- if (strokeCb) {
18137
- strokeCb(context, group.attribute, groupAttribute);
18138
- }
18139
- else if (sVisible) {
18140
- context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);
18141
- context.stroke();
18142
- }
18407
+ else {
18408
+ _runStroke();
18409
+ _runFill();
18143
18410
  }
18144
18411
  this._groupRenderContribitions.forEach(c => {
18145
18412
  if (c.time === BaseRenderContributionTime.afterFillStroke) {
@@ -18239,7 +18506,7 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
18239
18506
  }
18240
18507
  drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) {
18241
18508
  const imageAttribute = getTheme(image).image;
18242
- const { width = imageAttribute.width, height = imageAttribute.height, repeatX = imageAttribute.repeatX, repeatY = imageAttribute.repeatY, x: originX = imageAttribute.x, y: originY = imageAttribute.y, cornerRadius = imageAttribute.cornerRadius, image: url } = image.attribute;
18509
+ const { width = imageAttribute.width, height = imageAttribute.height, repeatX = imageAttribute.repeatX, repeatY = imageAttribute.repeatY, x: originX = imageAttribute.x, y: originY = imageAttribute.y, cornerRadius = imageAttribute.cornerRadius, fillStrokeOrder = imageAttribute.fillStrokeOrder, image: url } = image.attribute;
18243
18510
  const data = this.valid(image, imageAttribute, fillCb);
18244
18511
  if (!data) {
18245
18512
  return;
@@ -18247,58 +18514,70 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
18247
18514
  const { fVisible, sVisible, doFill, doStroke } = data;
18248
18515
  context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute);
18249
18516
  this.beforeRenderStep(image, context, x, y, doFill, false, fVisible, false, imageAttribute, drawContext, fillCb);
18250
- if (doFill) {
18251
- if (fillCb) {
18252
- fillCb(context, image.attribute, imageAttribute);
18253
- }
18254
- else if (fVisible) {
18255
- if (!url || !image.resources) {
18256
- return;
18257
- }
18258
- const res = image.resources.get(url);
18259
- if (res.state !== 'success') {
18260
- return;
18517
+ const _runFill = () => {
18518
+ if (doFill) {
18519
+ if (fillCb) {
18520
+ fillCb(context, image.attribute, imageAttribute);
18261
18521
  }
18262
- let needRestore = false;
18263
- if (cornerRadius === 0 || (isArray(cornerRadius) && cornerRadius.every(num => num === 0))) ;
18264
- else {
18265
- context.beginPath();
18266
- createRectPath(context, x, y, width, height, cornerRadius);
18267
- context.save();
18268
- context.clip();
18269
- needRestore = true;
18270
- }
18271
- context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
18272
- let repeat = 0;
18273
- if (repeatX === 'repeat') {
18274
- repeat |= 0b0001;
18275
- }
18276
- if (repeatY === 'repeat') {
18277
- repeat |= 0b0010;
18278
- }
18279
- if (repeat) {
18280
- const pattern = context.createPattern(res.data, repeatStr[repeat]);
18281
- context.fillStyle = pattern;
18282
- context.translate(x, y, true);
18283
- context.fillRect(0, 0, width, height);
18284
- context.translate(-x, -y, true);
18522
+ else if (fVisible) {
18523
+ if (!url || !image.resources) {
18524
+ return;
18525
+ }
18526
+ const res = image.resources.get(url);
18527
+ if (res.state !== 'success') {
18528
+ return;
18529
+ }
18530
+ let needRestore = false;
18531
+ if (cornerRadius === 0 || (isArray(cornerRadius) && cornerRadius.every(num => num === 0))) ;
18532
+ else {
18533
+ context.beginPath();
18534
+ createRectPath(context, x, y, width, height, cornerRadius);
18535
+ context.save();
18536
+ context.clip();
18537
+ needRestore = true;
18538
+ }
18539
+ context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
18540
+ let repeat = 0;
18541
+ if (repeatX === 'repeat') {
18542
+ repeat |= 0b0001;
18543
+ }
18544
+ if (repeatY === 'repeat') {
18545
+ repeat |= 0b0010;
18546
+ }
18547
+ if (repeat) {
18548
+ const pattern = context.createPattern(res.data, repeatStr[repeat]);
18549
+ context.fillStyle = pattern;
18550
+ context.translate(x, y, true);
18551
+ context.fillRect(0, 0, width, height);
18552
+ context.translate(-x, -y, true);
18553
+ }
18554
+ else {
18555
+ context.drawImage(res.data, x, y, width, height);
18556
+ }
18557
+ if (needRestore) {
18558
+ context.restore();
18559
+ }
18285
18560
  }
18286
- else {
18287
- context.drawImage(res.data, x, y, width, height);
18561
+ }
18562
+ };
18563
+ const _runStroke = () => {
18564
+ if (doStroke) {
18565
+ if (strokeCb) {
18566
+ strokeCb(context, image.attribute, imageAttribute);
18288
18567
  }
18289
- if (needRestore) {
18290
- context.restore();
18568
+ else if (sVisible) {
18569
+ context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute);
18570
+ context.stroke();
18291
18571
  }
18292
18572
  }
18573
+ };
18574
+ if (!fillStrokeOrder) {
18575
+ _runFill();
18576
+ _runStroke();
18293
18577
  }
18294
- if (doStroke) {
18295
- if (strokeCb) {
18296
- strokeCb(context, image.attribute, imageAttribute);
18297
- }
18298
- else if (sVisible) {
18299
- context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute);
18300
- context.stroke();
18301
- }
18578
+ else {
18579
+ _runStroke();
18580
+ _runFill();
18302
18581
  }
18303
18582
  this.afterRenderStep(image, context, x, y, doFill, false, fVisible, false, imageAttribute, drawContext, fillCb);
18304
18583
  }
@@ -18866,7 +19145,7 @@ class CanvasTextLayout {
18866
19145
  this.textOptions = options;
18867
19146
  this.textMeasure = textMeasure;
18868
19147
  }
18869
- LayoutBBox(bbox, textAlign, textBaseline) {
19148
+ LayoutBBox(bbox, textAlign, textBaseline, linesLayout) {
18870
19149
  if (textAlign === 'left' || textAlign === 'start') {
18871
19150
  bbox.xOffset = 0;
18872
19151
  }
@@ -18886,73 +19165,52 @@ class CanvasTextLayout {
18886
19165
  bbox.yOffset = bbox.height / -2;
18887
19166
  }
18888
19167
  else if (textBaseline === 'alphabetic') {
18889
- bbox.yOffset = bbox.height * -0.79;
19168
+ let percent = 0.79;
19169
+ if (linesLayout.length === 1) {
19170
+ const lineInfo = linesLayout[0];
19171
+ percent = lineInfo.ascent / (lineInfo.ascent + lineInfo.descent);
19172
+ }
19173
+ bbox.yOffset = bbox.height * -percent;
18890
19174
  }
18891
19175
  else {
18892
19176
  bbox.yOffset = -bbox.height;
18893
19177
  }
18894
19178
  return bbox;
18895
19179
  }
18896
- GetLayout(str, width, height, textAlign, textBaseline, lineHeight, suffix, wordBreak, suffixPosition) {
18897
- const linesLayout = [];
18898
- const bboxWH = [width, height];
18899
- const bboxOffset = [0, 0];
18900
- while (str.length > 0) {
18901
- const { str: clipText } = this.textMeasure.clipTextWithSuffix(str, this.textOptions, width, suffix, wordBreak, suffixPosition);
18902
- linesLayout.push({
18903
- str: clipText,
18904
- width: this.textMeasure.measureTextWidth(clipText, this.textOptions)
18905
- });
18906
- str = str.substring(clipText.length);
18907
- }
18908
- if (textAlign === 'left' || textAlign === 'start') ;
18909
- else if (textAlign === 'center') {
18910
- bboxOffset[0] = bboxWH[0] / -2;
18911
- }
18912
- else if (textAlign === 'right' || textAlign === 'end') {
18913
- bboxOffset[0] = -bboxWH[0];
18914
- }
18915
- if (textBaseline === 'top') ;
18916
- else if (textBaseline === 'middle') {
18917
- bboxOffset[1] = bboxWH[1] / -2;
18918
- }
18919
- else if (textBaseline === 'bottom') {
18920
- bboxOffset[1] = -bboxWH[1];
18921
- }
18922
- const bbox = {
18923
- xOffset: bboxOffset[0],
18924
- yOffset: bboxOffset[1],
18925
- width: bboxWH[0],
18926
- height: bboxWH[1]
18927
- };
18928
- return this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
18929
- }
18930
- 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, keepCenterInLine = false } = params !== null && params !== void 0 ? params : {};
18931
19182
  lines = lines.map(l => l.toString());
18932
19183
  const linesLayout = [];
18933
19184
  const bboxWH = [0, 0];
18934
19185
  if (typeof lineWidth === 'number' && lineWidth !== Infinity) {
18935
19186
  let width;
18936
19187
  for (let i = 0, len = lines.length; i < len; i++) {
18937
- 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);
18938
19190
  linesLayout.push({
18939
- str: this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
18940
- 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,
19197
+ keepCenterInLine
18941
19198
  });
18942
19199
  }
18943
19200
  bboxWH[0] = lineWidth;
18944
19201
  }
18945
19202
  else {
18946
- lineWidth = 0;
19203
+ let _lineWidth = 0;
18947
19204
  let width;
18948
19205
  let text;
18949
19206
  for (let i = 0, len = lines.length; i < len; i++) {
18950
19207
  text = lines[i];
18951
- width = this.textMeasure.measureTextWidth(text, this.textOptions);
18952
- lineWidth = Math.max(lineWidth, width);
18953
- linesLayout.push({ str: text, width });
19208
+ const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions, measureMode);
19209
+ width = metrics.width;
19210
+ _lineWidth = Math.max(_lineWidth, width);
19211
+ linesLayout.push({ str: text, width, ascent: metrics.ascent, descent: metrics.descent, keepCenterInLine });
18954
19212
  }
18955
- bboxWH[0] = lineWidth;
19213
+ bboxWH[0] = _lineWidth;
18956
19214
  }
18957
19215
  bboxWH[1] = linesLayout.length * lineHeight;
18958
19216
  bboxWH[0] = linesLayout.reduce((a, b) => Math.max(a, b.width), 0);
@@ -18962,7 +19220,7 @@ class CanvasTextLayout {
18962
19220
  width: bboxWH[0],
18963
19221
  height: bboxWH[1]
18964
19222
  };
18965
- this.LayoutBBox(bbox, textAlign, textBaseline);
19223
+ this.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
18966
19224
  return this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
18967
19225
  }
18968
19226
  layoutWithBBox(bbox, lines, textAlign, textBaseline, lineHeight) {
@@ -18999,7 +19257,20 @@ class CanvasTextLayout {
18999
19257
  else if (textAlign === 'right' || textAlign === 'end') {
19000
19258
  line.leftOffset = bbox.width - line.width;
19001
19259
  }
19002
- line.topOffset = (lineHeight - this.textOptions.fontSize) / 2 + this.textOptions.fontSize * 0.79 + origin[1];
19260
+ line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1];
19261
+ if (!line.keepCenterInLine) {
19262
+ const actualHeight = line.ascent + line.descent;
19263
+ const buf = 0;
19264
+ const actualHeightWithBuf = actualHeight + buf;
19265
+ if (actualHeightWithBuf < lineHeight - buf) {
19266
+ if (textBaseline === 'bottom') {
19267
+ line.topOffset += (lineHeight - actualHeightWithBuf) / 2;
19268
+ }
19269
+ else if (textBaseline === 'top') {
19270
+ line.topOffset -= (lineHeight - actualHeightWithBuf) / 2;
19271
+ }
19272
+ }
19273
+ }
19003
19274
  origin[1] += lineHeight;
19004
19275
  return line;
19005
19276
  }
@@ -19008,6 +19279,7 @@ class CanvasTextLayout {
19008
19279
  const TEXT_UPDATE_TAG_KEY = [
19009
19280
  'text',
19010
19281
  'maxLineWidth',
19282
+ 'maxWidth',
19011
19283
  'textAlign',
19012
19284
  'textBaseline',
19013
19285
  'heightLimit',
@@ -19035,20 +19307,14 @@ class Text extends Graphic {
19035
19307
  var _a;
19036
19308
  const attribute = this.attribute;
19037
19309
  const textTheme = this.getGraphicTheme();
19038
- if (!this.isSimplify()) {
19039
- return undefined;
19040
- }
19041
- const { maxLineWidth = textTheme.maxLineWidth } = attribute;
19042
- if (!Number.isFinite(maxLineWidth)) {
19310
+ const maxWidth = this.getMaxWidth(textTheme);
19311
+ if (!Number.isFinite(maxWidth)) {
19043
19312
  return ((_a = attribute.text) !== null && _a !== void 0 ? _a : textTheme.text).toString();
19044
19313
  }
19045
19314
  this.tryUpdateAABBBounds();
19046
19315
  return this.cache.clipedText;
19047
19316
  }
19048
19317
  get clipedWidth() {
19049
- if (!this.isSimplify()) {
19050
- return undefined;
19051
- }
19052
19318
  this.tryUpdateAABBBounds();
19053
19319
  return this.cache.clipedWidth;
19054
19320
  }
@@ -19056,10 +19322,11 @@ class Text extends Graphic {
19056
19322
  var _a, _b;
19057
19323
  const textTheme = this.getGraphicTheme();
19058
19324
  const attribute = this.attribute;
19059
- const { maxLineWidth = textTheme.maxLineWidth, text, whiteSpace = textTheme.whiteSpace } = attribute;
19060
- if (!Number.isFinite(maxLineWidth)) {
19325
+ const maxWidth = this.getMaxWidth(textTheme);
19326
+ if (!Number.isFinite(maxWidth)) {
19061
19327
  return false;
19062
19328
  }
19329
+ const { text } = this.attribute;
19063
19330
  this.tryUpdateAABBBounds();
19064
19331
  if ((_b = (_a = this.cache) === null || _a === void 0 ? void 0 : _a.layoutData) === null || _b === void 0 ? void 0 : _b.lines) {
19065
19332
  let mergedText = '';
@@ -19078,15 +19345,9 @@ class Text extends Graphic {
19078
19345
  return this.clipedText !== attribute.text.toString();
19079
19346
  }
19080
19347
  get multilineLayout() {
19081
- if (!this.isMultiLine) {
19082
- return undefined;
19083
- }
19084
19348
  this.tryUpdateAABBBounds();
19085
19349
  return this.cache.layoutData;
19086
19350
  }
19087
- isSimplify() {
19088
- return !this.isMultiLine && this.attribute.direction !== 'vertical';
19089
- }
19090
19351
  get isMultiLine() {
19091
19352
  return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';
19092
19353
  }
@@ -19154,13 +19415,74 @@ class Text extends Graphic {
19154
19415
  transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix);
19155
19416
  return aabbBounds;
19156
19417
  }
19418
+ updateSingallineAABBBounds(text) {
19419
+ this.updateMultilineAABBBounds([text]);
19420
+ const layoutData = this.cache.layoutData;
19421
+ if (layoutData) {
19422
+ const line = layoutData.lines[0];
19423
+ this.cache.clipedText = line.str;
19424
+ this.cache.clipedWidth = line.width;
19425
+ }
19426
+ return this._AABBBounds;
19427
+ }
19428
+ updateMultilineAABBBounds(text) {
19429
+ const textTheme = this.getGraphicTheme();
19430
+ const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;
19431
+ const b = direction === 'horizontal'
19432
+ ? this.updateHorizontalMultilineAABBBounds(text)
19433
+ : this.updateVerticalMultilineAABBBounds(text);
19434
+ if (direction === 'horizontal') {
19435
+ if (underlineOffset) {
19436
+ this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);
19437
+ }
19438
+ }
19439
+ return b;
19440
+ }
19441
+ guessLineHeightBuf(fontSize) {
19442
+ return fontSize ? fontSize * 0.1 : 0;
19443
+ }
19444
+ updateHorizontalMultilineAABBBounds(text) {
19445
+ var _a;
19446
+ const textTheme = this.getGraphicTheme();
19447
+ const attribute = this.attribute;
19448
+ 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, keepCenterInLine = textTheme.keepCenterInLine } = attribute;
19449
+ const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);
19450
+ const lineHeight = this.getLineHeight(attribute, textTheme) + buf;
19451
+ if (whiteSpace === 'normal' || wrap) {
19452
+ return this.updateWrapAABBBounds(text);
19453
+ }
19454
+ if (!this.shouldUpdateShape() && ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.layoutData)) {
19455
+ const bbox = this.cache.layoutData.bbox;
19456
+ this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
19457
+ if (stroke) {
19458
+ this._AABBBounds.expand(lineWidth / 2);
19459
+ }
19460
+ return this._AABBBounds;
19461
+ }
19462
+ const textMeasure = application.graphicUtil.textMeasure;
19463
+ const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily, lineHeight }, textMeasure);
19464
+ const layoutData = layoutObj.GetLayoutByLines(text, textAlign, textBaseline, lineHeight, ellipsis === true ? textTheme.ellipsis : ellipsis || undefined, false, {
19465
+ lineWidth: maxLineWidth,
19466
+ suffixPosition,
19467
+ measureMode,
19468
+ keepCenterInLine
19469
+ });
19470
+ const { bbox } = layoutData;
19471
+ this.cache.layoutData = layoutData;
19472
+ this.clearUpdateShapeTag();
19473
+ this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
19474
+ if (stroke) {
19475
+ this._AABBBounds.expand(lineWidth / 2);
19476
+ }
19477
+ return this._AABBBounds;
19478
+ }
19157
19479
  updateWrapAABBBounds(text) {
19158
- var _a, _b, _c, _d;
19480
+ var _a, _b, _c;
19159
19481
  const textTheme = this.getGraphicTheme();
19160
- 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;
19161
- const lineHeight = (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (this.attribute.fontSize || textTheme.fontSize);
19162
- const buf = ignoreBuf ? 0 : 2;
19163
- if (!this.shouldUpdateShape() && ((_b = this.cache) === null || _b === void 0 ? void 0 : _b.layoutData)) {
19482
+ 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, keepCenterInLine = textTheme.keepCenterInLine } = this.attribute;
19483
+ const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);
19484
+ const lineHeight = this.getLineHeight(this.attribute, textTheme) + buf;
19485
+ if (!this.shouldUpdateShape() && ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.layoutData)) {
19164
19486
  const bbox = this.cache.layoutData.bbox;
19165
19487
  this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
19166
19488
  if (stroke) {
@@ -19169,7 +19491,8 @@ class Text extends Graphic {
19169
19491
  return this._AABBBounds;
19170
19492
  }
19171
19493
  const textMeasure = application.graphicUtil.textMeasure;
19172
- const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure);
19494
+ const textOptions = { fontSize, fontWeight, fontFamily, lineHeight };
19495
+ const layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure);
19173
19496
  const lines = isArray(text) ? text.map(l => l.toString()) : [text.toString()];
19174
19497
  const linesLayout = [];
19175
19498
  const bboxWH = [0, 0];
@@ -19186,19 +19509,23 @@ class Text extends Graphic {
19186
19509
  const str = lines[i];
19187
19510
  let needCut = true;
19188
19511
  if (i === lineCountLimit - 1) {
19189
- const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition, i !== lines.length - 1);
19512
+ const clip = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, false, suffixPosition, i !== lines.length - 1);
19513
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
19190
19514
  linesLayout.push({
19191
19515
  str: clip.str,
19192
- width: clip.width
19516
+ width: clip.width,
19517
+ ascent: matrics.ascent,
19518
+ descent: matrics.descent,
19519
+ keepCenterInLine
19193
19520
  });
19194
19521
  break;
19195
19522
  }
19196
- const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, wordBreak !== 'break-all', wordBreak === 'keep-all');
19523
+ const clip = textMeasure.clipText(str, textOptions, maxLineWidth, wordBreak !== 'break-all', wordBreak === 'keep-all');
19197
19524
  if ((str !== '' && clip.str === '') || clip.wordBreaked) {
19198
19525
  if (ellipsis) {
19199
- const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19200
- clip.str = (_c = clipEllipsis.str) !== null && _c !== void 0 ? _c : '';
19201
- clip.width = (_d = clipEllipsis.width) !== null && _d !== void 0 ? _d : 0;
19526
+ const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19527
+ clip.str = (_b = clipEllipsis.str) !== null && _b !== void 0 ? _b : '';
19528
+ clip.width = (_c = clipEllipsis.width) !== null && _c !== void 0 ? _c : 0;
19202
19529
  }
19203
19530
  else {
19204
19531
  clip.str = '';
@@ -19206,9 +19533,13 @@ class Text extends Graphic {
19206
19533
  }
19207
19534
  needCut = false;
19208
19535
  }
19536
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
19209
19537
  linesLayout.push({
19210
19538
  str: clip.str,
19211
- width: clip.width
19539
+ width: clip.width,
19540
+ ascent: matrics.ascent,
19541
+ descent: matrics.descent,
19542
+ keepCenterInLine
19212
19543
  });
19213
19544
  let cutLength = clip.str.length;
19214
19545
  if (clip.wordBreaked && !(str !== '' && clip.str === '')) {
@@ -19217,10 +19548,7 @@ class Text extends Graphic {
19217
19548
  }
19218
19549
  if (clip.str.length === str.length) ;
19219
19550
  else if (needCut) {
19220
- let newStr = str.substring(cutLength);
19221
- if (wordBreak === 'keep-all') {
19222
- newStr = newStr.replace(/^\s+/g, '');
19223
- }
19551
+ const newStr = str.substring(cutLength);
19224
19552
  lines.splice(i + 1, 0, newStr);
19225
19553
  }
19226
19554
  }
@@ -19237,29 +19565,34 @@ class Text extends Graphic {
19237
19565
  let text;
19238
19566
  for (let i = 0, len = lines.length; i < len; i++) {
19239
19567
  if (i === lineCountLimit - 1) {
19240
- const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19568
+ const clip = textMeasure.clipTextWithSuffix(lines[i], textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19569
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
19241
19570
  linesLayout.push({
19242
19571
  str: clip.str,
19243
- width: clip.width
19572
+ width: clip.width,
19573
+ ascent: matrics.ascent,
19574
+ descent: matrics.descent,
19575
+ keepCenterInLine
19244
19576
  });
19245
19577
  lineWidth = Math.max(lineWidth, clip.width);
19246
19578
  break;
19247
19579
  }
19248
19580
  text = lines[i];
19249
- width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, wordBreak === 'break-word');
19581
+ width = textMeasure.measureTextWidth(text, textOptions);
19250
19582
  lineWidth = Math.max(lineWidth, width);
19251
- linesLayout.push({ str: text, width });
19583
+ const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);
19584
+ linesLayout.push({ str: text, width, ascent: matrics.ascent, descent: matrics.descent, keepCenterInLine });
19252
19585
  }
19253
19586
  bboxWH[0] = lineWidth;
19254
19587
  }
19255
- bboxWH[1] = linesLayout.length * (lineHeight + buf);
19588
+ bboxWH[1] = linesLayout.length * lineHeight;
19256
19589
  const bbox = {
19257
19590
  xOffset: 0,
19258
19591
  yOffset: 0,
19259
19592
  width: bboxWH[0],
19260
19593
  height: bboxWH[1]
19261
19594
  };
19262
- layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
19595
+ layoutObj.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
19263
19596
  const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
19264
19597
  this.cache.layoutData = layoutData;
19265
19598
  this.clearUpdateShapeTag();
@@ -19269,212 +19602,19 @@ class Text extends Graphic {
19269
19602
  }
19270
19603
  return this._AABBBounds;
19271
19604
  }
19272
- updateSingallineAABBBounds(text) {
19273
- const textTheme = this.getGraphicTheme();
19274
- const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;
19275
- const b = direction === 'horizontal'
19276
- ? this.updateHorizontalSinglelineAABBBounds(text)
19277
- : this.updateVerticalSinglelineAABBBounds(text);
19278
- if (direction === 'horizontal') {
19279
- if (underlineOffset) {
19280
- this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);
19281
- }
19282
- }
19283
- return b;
19284
- }
19285
- updateMultilineAABBBounds(text) {
19286
- const textTheme = this.getGraphicTheme();
19287
- const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;
19288
- const b = direction === 'horizontal'
19289
- ? this.updateHorizontalMultilineAABBBounds(text)
19290
- : this.updateVerticalMultilineAABBBounds(text);
19291
- if (direction === 'horizontal') {
19292
- if (underlineOffset) {
19293
- this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);
19294
- }
19295
- }
19296
- return b;
19297
- }
19298
- updateHorizontalSinglelineAABBBounds(text) {
19299
- var _a, _b;
19300
- const textTheme = this.getGraphicTheme();
19301
- const { wrap = textTheme.wrap } = this.attribute;
19302
- if (wrap) {
19303
- return this.updateWrapAABBBounds([text]);
19304
- }
19305
- const textMeasure = application.graphicUtil.textMeasure;
19306
- let width;
19307
- let str;
19308
- const attribute = this.attribute;
19309
- 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;
19310
- if (whiteSpace === 'normal') {
19311
- return this.updateWrapAABBBounds(text);
19312
- }
19313
- const buf = ignoreBuf ? 0 : Math.max(2, fontSize * 0.075);
19314
- const textFontSize = attribute.fontSize || textTheme.fontSize;
19315
- const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) !== null && _a !== void 0 ? _a : textFontSize + buf;
19316
- if (!this.shouldUpdateShape() && this.cache) {
19317
- width = (_b = this.cache.clipedWidth) !== null && _b !== void 0 ? _b : 0;
19318
- const dx = textDrawOffsetX(textAlign, width);
19319
- const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
19320
- this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight);
19321
- if (stroke) {
19322
- this._AABBBounds.expand(lineWidth / 2);
19323
- }
19324
- return this._AABBBounds;
19325
- }
19326
- if (Number.isFinite(maxLineWidth)) {
19327
- if (ellipsis) {
19328
- const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis);
19329
- const data = textMeasure.clipTextWithSuffix(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false, suffixPosition);
19330
- str = data.str;
19331
- width = data.width;
19332
- }
19333
- else {
19334
- const data = textMeasure.clipText(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, false);
19335
- str = data.str;
19336
- width = data.width;
19337
- }
19338
- this.cache.clipedText = str;
19339
- this.cache.clipedWidth = width;
19340
- }
19341
- else {
19342
- width = textMeasure.measureTextWidth(text.toString(), { fontSize, fontWeight, fontFamily });
19343
- this.cache.clipedText = text.toString();
19344
- this.cache.clipedWidth = width;
19345
- }
19346
- this.clearUpdateShapeTag();
19347
- const dx = textDrawOffsetX(textAlign, width);
19348
- let lh = lineHeight;
19349
- if (application.global && application.global.isSafari()) {
19350
- lh += fontSize * 0.2;
19351
- }
19352
- const dy = textLayoutOffsetY(textBaseline, lh, fontSize, buf);
19353
- this._AABBBounds.set(dx, dy, dx + width, dy + lh);
19354
- if (stroke) {
19355
- this._AABBBounds.expand(lineWidth / 2);
19356
- }
19357
- return this._AABBBounds;
19358
- }
19359
- getBaselineMapAlign() {
19360
- return Text.baselineMapAlign;
19361
- }
19362
- getAlignMapBaseline() {
19363
- return Text.alignMapBaseline;
19364
- }
19365
- updateVerticalSinglelineAABBBounds(text) {
19366
- var _a, _b, _c;
19367
- const textTheme = this.getGraphicTheme();
19368
- const textMeasure = application.graphicUtil.textMeasure;
19369
- let width;
19370
- const attribute = this.attribute;
19371
- const { ignoreBuf = textTheme.ignoreBuf } = attribute;
19372
- const buf = ignoreBuf ? 0 : 2;
19373
- 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;
19374
- const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
19375
- let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;
19376
- if (!verticalMode) {
19377
- const t = textAlign;
19378
- textAlign = (_b = Text.baselineMapAlign[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
19379
- textBaseline = (_c = Text.alignMapBaseline[t]) !== null && _c !== void 0 ? _c : 'top';
19380
- }
19381
- if (!this.shouldUpdateShape() && this.cache) {
19382
- width = this.cache.clipedWidth;
19383
- const dx = textDrawOffsetX(textAlign, width);
19384
- const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
19385
- this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);
19386
- if (stroke) {
19387
- this._AABBBounds.expand(lineWidth / 2);
19388
- }
19389
- return this._AABBBounds;
19390
- }
19391
- let verticalList = [
19392
- verticalLayout(text.toString())
19393
- ];
19394
- if (Number.isFinite(maxLineWidth)) {
19395
- if (ellipsis) {
19396
- const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis);
19397
- const data = textMeasure.clipTextWithSuffixVertical(verticalList[0], { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false, suffixPosition);
19398
- verticalList = [data.verticalList];
19399
- width = data.width;
19400
- }
19401
- else {
19402
- const data = textMeasure.clipTextVertical(verticalList[0], { fontSize, fontWeight, fontFamily }, maxLineWidth, false);
19403
- verticalList = [data.verticalList];
19404
- width = data.width;
19405
- }
19406
- this.cache.verticalList = verticalList;
19407
- this.cache.clipedWidth = width;
19408
- }
19409
- else {
19410
- width = 0;
19411
- verticalList[0].forEach(t => {
19412
- const w = t.direction === TextDirection.HORIZONTAL
19413
- ? fontSize
19414
- : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });
19415
- width += w;
19416
- t.width = w;
19417
- });
19418
- this.cache.verticalList = verticalList;
19419
- this.cache.clipedWidth = width;
19420
- }
19421
- this.clearUpdateShapeTag();
19422
- const dx = textDrawOffsetX(textAlign, width);
19423
- const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);
19424
- this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);
19425
- if (stroke) {
19426
- this._AABBBounds.expand(lineWidth / 2);
19427
- }
19428
- return this._AABBBounds;
19429
- }
19430
- updateHorizontalMultilineAABBBounds(text) {
19431
- var _a, _b;
19432
- const textTheme = this.getGraphicTheme();
19433
- const { wrap = textTheme.wrap } = this.attribute;
19434
- if (wrap) {
19435
- return this.updateWrapAABBBounds(text);
19436
- }
19437
- const attribute = this.attribute;
19438
- 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;
19439
- const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize);
19440
- if (whiteSpace === 'normal') {
19441
- return this.updateWrapAABBBounds(text);
19442
- }
19443
- if (!this.shouldUpdateShape() && ((_b = this.cache) === null || _b === void 0 ? void 0 : _b.layoutData)) {
19444
- const bbox = this.cache.layoutData.bbox;
19445
- this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
19446
- if (stroke) {
19447
- this._AABBBounds.expand(lineWidth / 2);
19448
- }
19449
- return this._AABBBounds;
19450
- }
19451
- const textMeasure = application.graphicUtil.textMeasure;
19452
- const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure);
19453
- const layoutData = layoutObj.GetLayoutByLines(text, textAlign, textBaseline, lineHeight, ellipsis === true ? textTheme.ellipsis : ellipsis || undefined, false, maxLineWidth, suffixPosition);
19454
- const { bbox } = layoutData;
19455
- this.cache.layoutData = layoutData;
19456
- this.clearUpdateShapeTag();
19457
- this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
19458
- if (stroke) {
19459
- this._AABBBounds.expand(lineWidth / 2);
19460
- }
19461
- return this._AABBBounds;
19462
- }
19463
19605
  updateVerticalMultilineAABBBounds(text) {
19464
- var _a, _b, _c;
19606
+ var _a, _b;
19465
19607
  const textTheme = this.getGraphicTheme();
19466
19608
  const textMeasure = application.graphicUtil.textMeasure;
19467
19609
  let width;
19468
19610
  const attribute = this.attribute;
19469
- const { ignoreBuf = textTheme.ignoreBuf } = attribute;
19470
- const buf = ignoreBuf ? 0 : 2;
19471
19611
  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;
19472
- const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
19612
+ const lineHeight = this.getLineHeight(attribute, textTheme);
19473
19613
  let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;
19474
19614
  if (!verticalMode) {
19475
19615
  const t = textAlign;
19476
- textAlign = (_b = Text.baselineMapAlign[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
19477
- textBaseline = (_c = Text.alignMapBaseline[t]) !== null && _c !== void 0 ? _c : 'top';
19616
+ textAlign = (_a = Text.baselineMapAlign[textBaseline]) !== null && _a !== void 0 ? _a : 'left';
19617
+ textBaseline = (_b = Text.alignMapBaseline[t]) !== null && _b !== void 0 ? _b : 'top';
19478
19618
  }
19479
19619
  width = 0;
19480
19620
  if (!this.shouldUpdateShape() && this.cache) {
@@ -19534,6 +19674,15 @@ class Text extends Graphic {
19534
19674
  }
19535
19675
  return this._AABBBounds;
19536
19676
  }
19677
+ getMaxWidth(theme) {
19678
+ var _a, _b;
19679
+ const attribute = this.attribute;
19680
+ return (_b = (_a = attribute.maxLineWidth) !== null && _a !== void 0 ? _a : attribute.maxWidth) !== null && _b !== void 0 ? _b : theme.maxWidth;
19681
+ }
19682
+ getLineHeight(attribute, textTheme) {
19683
+ var _a;
19684
+ return ((_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize));
19685
+ }
19537
19686
  needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
19538
19687
  return super.needUpdateTags(keys, k);
19539
19688
  }
@@ -19546,6 +19695,12 @@ class Text extends Graphic {
19546
19695
  getNoWorkAnimateAttr() {
19547
19696
  return Text.NOWORK_ANIMATE_ATTR;
19548
19697
  }
19698
+ getBaselineMapAlign() {
19699
+ return Text.baselineMapAlign;
19700
+ }
19701
+ getAlignMapBaseline() {
19702
+ return Text.alignMapBaseline;
19703
+ }
19549
19704
  }
19550
19705
  Text.NOWORK_ANIMATE_ATTR = Object.assign({ ellipsis: 1, wordBreak: 1, direction: 1, textAlign: 1, textBaseline: 1, fontFamily: 1, fontWeight: 1 }, NOWORK_ANIMATE_ATTR);
19551
19706
  Text.baselineMapAlign = {
@@ -19609,7 +19764,10 @@ class WrapText extends Text {
19609
19764
  const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19610
19765
  linesLayout.push({
19611
19766
  str: clip.str,
19612
- width: clip.width
19767
+ width: clip.width,
19768
+ ascent: 0,
19769
+ descent: 0,
19770
+ keepCenterInLine: false
19613
19771
  });
19614
19772
  break;
19615
19773
  }
@@ -19628,7 +19786,10 @@ class WrapText extends Text {
19628
19786
  }
19629
19787
  linesLayout.push({
19630
19788
  str: clip.str,
19631
- width: clip.width
19789
+ width: clip.width,
19790
+ ascent: 0,
19791
+ descent: 0,
19792
+ keepCenterInLine: false
19632
19793
  });
19633
19794
  if (clip.str.length === str.length) ;
19634
19795
  else if (needCut) {
@@ -19652,7 +19813,10 @@ class WrapText extends Text {
19652
19813
  const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19653
19814
  linesLayout.push({
19654
19815
  str: clip.str,
19655
- width: clip.width
19816
+ width: clip.width,
19817
+ ascent: 0,
19818
+ descent: 0,
19819
+ keepCenterInLine: false
19656
19820
  });
19657
19821
  lineWidth = Math.max(lineWidth, clip.width);
19658
19822
  break;
@@ -19660,7 +19824,7 @@ class WrapText extends Text {
19660
19824
  text = lines[i];
19661
19825
  width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, wordBreak === 'break-word');
19662
19826
  lineWidth = Math.max(lineWidth, width);
19663
- linesLayout.push({ str: text, width });
19827
+ linesLayout.push({ str: text, width, ascent: 0, descent: 0, keepCenterInLine: false });
19664
19828
  }
19665
19829
  bboxWH[0] = lineWidth;
19666
19830
  }
@@ -19723,6 +19887,9 @@ class BaseSymbol {
19723
19887
  bounds.y2 = size[1] / 2;
19724
19888
  }
19725
19889
  }
19890
+ parseSize(size) {
19891
+ return isNumber(size) ? size : Math.min(size[0], size[1]);
19892
+ }
19726
19893
  }
19727
19894
 
19728
19895
  function circle(ctx, r, x, y, z) {
@@ -19741,15 +19908,15 @@ class CircleSymbol extends BaseSymbol {
19741
19908
  this.pathStr = 'M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0';
19742
19909
  }
19743
19910
  draw(ctx, size, x, y, z) {
19744
- const r = size / 2;
19911
+ const r = this.parseSize(size) / 2;
19745
19912
  return circle(ctx, r, x, y, z);
19746
19913
  }
19747
19914
  drawOffset(ctx, size, x, y, offset, z) {
19748
- const r = size / 2 + offset;
19915
+ const r = this.parseSize(size) / 2 + offset;
19749
19916
  return circle(ctx, r, x, y, z);
19750
19917
  }
19751
19918
  drawToSvgPath(size, x, y, z) {
19752
- const r = size / 2;
19919
+ const r = this.parseSize(size) / 2;
19753
19920
  return `M ${x - r}, ${y} a ${r},${r} 0 1,0 ${r * 2},0 a ${r},${r} 0 1,0 -${r * 2},0`;
19754
19921
  }
19755
19922
  }
@@ -19794,11 +19961,11 @@ class CrossSymbol extends BaseSymbol {
19794
19961
  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';
19795
19962
  }
19796
19963
  draw(ctx, size, x, y, z) {
19797
- const r = size / 6;
19964
+ const r = this.parseSize(size) / 6;
19798
19965
  return cross(ctx, r, x, y, z);
19799
19966
  }
19800
19967
  drawOffset(ctx, size, x, y, offset, z) {
19801
- const r = size / 6;
19968
+ const r = this.parseSize(size) / 6;
19802
19969
  return crossOffset(ctx, r, x, y, offset, z);
19803
19970
  }
19804
19971
  }
@@ -19819,15 +19986,15 @@ class DiamondSymbol extends BaseSymbol {
19819
19986
  this.pathStr = 'M-0.5,0L0,-0.5L0.5,0L0,0.5Z';
19820
19987
  }
19821
19988
  draw(ctx, size, x, y, z) {
19822
- const r = size / 2;
19989
+ const r = this.parseSize(size) / 2;
19823
19990
  return diamond(ctx, r, x, y, z);
19824
19991
  }
19825
19992
  drawFitDir(ctx, size, x, y, z) {
19826
- const r = size / 2;
19993
+ const r = this.parseSize(size) / 2;
19827
19994
  return diamond(ctx, r, x, y, z);
19828
19995
  }
19829
19996
  drawOffset(ctx, size, x, y, offset, z) {
19830
- const r = size / 2 + offset;
19997
+ const r = this.parseSize(size) / 2 + offset;
19831
19998
  return diamond(ctx, r, x, y, z);
19832
19999
  }
19833
20000
  }
@@ -19845,11 +20012,11 @@ class SquareSymbol extends BaseSymbol {
19845
20012
  this.pathStr = 'M-0.5,-0.5h1v1h-1Z';
19846
20013
  }
19847
20014
  draw(ctx, size, x, y) {
19848
- const r = size / 2;
20015
+ const r = this.parseSize(size) / 2;
19849
20016
  return square(ctx, r, x, y);
19850
20017
  }
19851
20018
  drawOffset(ctx, size, x, y, offset) {
19852
- const r = size / 2 + offset;
20019
+ const r = this.parseSize(size) / 2 + offset;
19853
20020
  return square(ctx, r, x, y);
19854
20021
  }
19855
20022
  }
@@ -19869,11 +20036,11 @@ class TriangleUpSymbol extends BaseSymbol {
19869
20036
  this.pathStr = 'M0.5,0.5 L-0.5,0.5 L0,-0.5 Z';
19870
20037
  }
19871
20038
  draw(ctx, size, x, y) {
19872
- const r = size / 2;
20039
+ const r = this.parseSize(size) / 2;
19873
20040
  return trianglUpOffset(ctx, r, x, y);
19874
20041
  }
19875
20042
  drawOffset(ctx, size, x, y, offset) {
19876
- const r = size / 2;
20043
+ const r = this.parseSize(size) / 2;
19877
20044
  return trianglUpOffset(ctx, r, x, y, offset);
19878
20045
  }
19879
20046
  }
@@ -19912,11 +20079,11 @@ class StarSymbol extends BaseSymbol {
19912
20079
  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';
19913
20080
  }
19914
20081
  draw(ctx, size, transX, transY) {
19915
- const r = size / 2;
20082
+ const r = this.parseSize(size) / 2;
19916
20083
  return star(ctx, r, transX, transY);
19917
20084
  }
19918
20085
  drawOffset(ctx, size, transX, transY, offset) {
19919
- const r = size / 2 + offset;
20086
+ const r = this.parseSize(size) / 2 + offset;
19920
20087
  return star(ctx, r, transX, transY);
19921
20088
  }
19922
20089
  }
@@ -19945,11 +20112,11 @@ class ArrowSymbol extends BaseSymbol {
19945
20112
  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';
19946
20113
  }
19947
20114
  draw(ctx, size, transX, transY) {
19948
- const r = size / 2;
20115
+ const r = this.parseSize(size) / 2;
19949
20116
  return arrow(ctx, r, transX, transY);
19950
20117
  }
19951
20118
  drawOffset(ctx, size, transX, transY, offset) {
19952
- const r = size / 2 + offset;
20119
+ const r = this.parseSize(size) / 2 + offset;
19953
20120
  return arrow(ctx, r, transX, transY);
19954
20121
  }
19955
20122
  }
@@ -19970,11 +20137,11 @@ class WedgeSymbol extends BaseSymbol {
19970
20137
  this.pathStr = 'M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z';
19971
20138
  }
19972
20139
  draw(ctx, size, transX, transY) {
19973
- const r = size / 2;
20140
+ const r = this.parseSize(size) / 2;
19974
20141
  return wedge(ctx, r, transX, transY);
19975
20142
  }
19976
20143
  drawOffset(ctx, size, transX, transY, offset) {
19977
- const r = size / 2 + offset;
20144
+ const r = this.parseSize(size) / 2 + offset;
19978
20145
  return wedge(ctx, r, transX, transY);
19979
20146
  }
19980
20147
  }
@@ -19992,11 +20159,11 @@ class StrokeSymbol extends BaseSymbol {
19992
20159
  this.pathStr = '';
19993
20160
  }
19994
20161
  draw(ctx, size, transX, transY) {
19995
- const r = size / 2;
20162
+ const r = this.parseSize(size) / 2;
19996
20163
  return stroke(ctx, r, transX, transY);
19997
20164
  }
19998
20165
  drawOffset(ctx, size, transX, transY, offset) {
19999
- const r = size / 2 + offset;
20166
+ const r = this.parseSize(size) / 2 + offset;
20000
20167
  return stroke(ctx, r, transX, transY);
20001
20168
  }
20002
20169
  }
@@ -20031,11 +20198,11 @@ class WyeSymbol extends BaseSymbol {
20031
20198
  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';
20032
20199
  }
20033
20200
  draw(ctx, size, transX, transY) {
20034
- const r = size / 2;
20201
+ const r = this.parseSize(size) / 2;
20035
20202
  return wye(ctx, r, transX, transY);
20036
20203
  }
20037
20204
  drawOffset(ctx, size, transX, transY, offset) {
20038
- const r = size / 2 + offset;
20205
+ const r = this.parseSize(size) / 2 + offset;
20039
20206
  return wye(ctx, r, transX, transY);
20040
20207
  }
20041
20208
  }
@@ -20055,11 +20222,11 @@ class TriangleLeftSymbol extends BaseSymbol {
20055
20222
  this.pathStr = 'M-0.5,0 L0.5,0.5 L0.5,-0.5 Z';
20056
20223
  }
20057
20224
  draw(ctx, size, x, y) {
20058
- const r = size / 2;
20225
+ const r = this.parseSize(size) / 2;
20059
20226
  return trianglLeftOffset(ctx, r, x, y, 0);
20060
20227
  }
20061
20228
  drawOffset(ctx, size, x, y, offset) {
20062
- const r = size / 2;
20229
+ const r = this.parseSize(size) / 2;
20063
20230
  return trianglLeftOffset(ctx, r, x, y, offset);
20064
20231
  }
20065
20232
  }
@@ -20079,11 +20246,11 @@ class TriangleRightSymbol extends BaseSymbol {
20079
20246
  this.pathStr = 'M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z';
20080
20247
  }
20081
20248
  draw(ctx, size, x, y) {
20082
- const r = size / 2;
20249
+ const r = this.parseSize(size) / 2;
20083
20250
  return trianglRightOffset(ctx, r, x, y);
20084
20251
  }
20085
20252
  drawOffset(ctx, size, x, y, offset) {
20086
- const r = size / 2;
20253
+ const r = this.parseSize(size) / 2;
20087
20254
  return trianglRightOffset(ctx, r, x, y, offset);
20088
20255
  }
20089
20256
  }
@@ -20103,11 +20270,11 @@ class TriangleDownSymbol extends BaseSymbol {
20103
20270
  this.pathStr = 'M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z';
20104
20271
  }
20105
20272
  draw(ctx, size, x, y) {
20106
- const r = size / 2;
20273
+ const r = this.parseSize(size) / 2;
20107
20274
  return trianglDownOffset(ctx, r, x, y);
20108
20275
  }
20109
20276
  drawOffset(ctx, size, x, y, offset) {
20110
- const r = size / 2;
20277
+ const r = this.parseSize(size) / 2;
20111
20278
  return trianglDownOffset(ctx, r, x, y, offset);
20112
20279
  }
20113
20280
  }
@@ -20129,11 +20296,11 @@ class ThinTriangleSymbol extends BaseSymbol {
20129
20296
  this.pathStr = 'M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z';
20130
20297
  }
20131
20298
  draw(ctx, size, x, y) {
20132
- const r = size / 2 / sqrt3;
20299
+ const r = this.parseSize(size) / 2 / sqrt3;
20133
20300
  return thinTriangle(ctx, r, x, y);
20134
20301
  }
20135
20302
  drawOffset(ctx, size, x, y, offset) {
20136
- const r = size / 2 / sqrt3 + offset;
20303
+ const r = this.parseSize(size) / 2 / sqrt3 + offset;
20137
20304
  return thinTriangle(ctx, r, x, y);
20138
20305
  }
20139
20306
  }
@@ -20153,11 +20320,11 @@ class Arrow2LeftSymbol extends BaseSymbol {
20153
20320
  this.pathStr = 'M 0.25 -0.5 L -0.25 0 l 0.25 0.5';
20154
20321
  }
20155
20322
  draw(ctx, size, transX, transY) {
20156
- const r = size / 4;
20323
+ const r = this.parseSize(size) / 4;
20157
20324
  return arrow2Left(ctx, r, transX, transY);
20158
20325
  }
20159
20326
  drawOffset(ctx, size, transX, transY, offset) {
20160
- const r = size / 4 + offset;
20327
+ const r = this.parseSize(size) / 4 + offset;
20161
20328
  return arrow2Left(ctx, r, transX, transY);
20162
20329
  }
20163
20330
  }
@@ -20177,11 +20344,11 @@ class Arrow2RightSymbol extends BaseSymbol {
20177
20344
  this.pathStr = 'M -0.25 -0.5 l 0.25 0 l -0.25 0.5';
20178
20345
  }
20179
20346
  draw(ctx, size, transX, transY) {
20180
- const r = size / 4;
20347
+ const r = this.parseSize(size) / 4;
20181
20348
  return arrow2Right(ctx, r, transX, transY);
20182
20349
  }
20183
20350
  drawOffset(ctx, size, transX, transY, offset) {
20184
- const r = size / 4 + offset;
20351
+ const r = this.parseSize(size) / 4 + offset;
20185
20352
  return arrow2Right(ctx, r, transX, transY);
20186
20353
  }
20187
20354
  }
@@ -20201,11 +20368,11 @@ class Arrow2UpSymbol extends BaseSymbol {
20201
20368
  this.pathStr = 'M -0.5 0.25 L 0 -0.25 l 0.5 0.25';
20202
20369
  }
20203
20370
  draw(ctx, size, transX, transY) {
20204
- const r = size / 4;
20371
+ const r = this.parseSize(size) / 4;
20205
20372
  return arrow2Up(ctx, r, transX, transY);
20206
20373
  }
20207
20374
  drawOffset(ctx, size, transX, transY, offset) {
20208
- const r = size / 4 + offset;
20375
+ const r = this.parseSize(size) / 4 + offset;
20209
20376
  return arrow2Up(ctx, r, transX, transY);
20210
20377
  }
20211
20378
  }
@@ -20225,11 +20392,11 @@ class Arrow2DownSymbol extends BaseSymbol {
20225
20392
  this.pathStr = 'M -0.5 -0.25 L 0 0.25 l 0.5 -0.25';
20226
20393
  }
20227
20394
  draw(ctx, size, transX, transY) {
20228
- const r = size / 4;
20395
+ const r = this.parseSize(size) / 4;
20229
20396
  return arrow2Down(ctx, r, transX, transY);
20230
20397
  }
20231
20398
  drawOffset(ctx, size, transX, transY, offset) {
20232
- const r = size / 4 + offset;
20399
+ const r = this.parseSize(size) / 4 + offset;
20233
20400
  return arrow2Down(ctx, r, transX, transY);
20234
20401
  }
20235
20402
  }
@@ -20247,15 +20414,15 @@ class LineVSymbol extends BaseSymbol {
20247
20414
  this.pathStr = 'M0,-0.5L0,0.5';
20248
20415
  }
20249
20416
  draw(ctx, size, x, y, z) {
20250
- const r = size / 2;
20417
+ const r = this.parseSize(size) / 2;
20251
20418
  return lineV(ctx, r, x, y);
20252
20419
  }
20253
20420
  drawOffset(ctx, size, x, y, offset, z) {
20254
- const r = size / 2 + offset;
20421
+ const r = this.parseSize(size) / 2 + offset;
20255
20422
  return lineV(ctx, r, x, y);
20256
20423
  }
20257
20424
  drawToSvgPath(size, x, y, z) {
20258
- const r = size / 2;
20425
+ const r = this.parseSize(size) / 2;
20259
20426
  return `M ${x}, ${y - r} L ${x},${y + r}`;
20260
20427
  }
20261
20428
  }
@@ -20273,15 +20440,15 @@ class LineHSymbol extends BaseSymbol {
20273
20440
  this.pathStr = 'M-0.5,0L0.5,0';
20274
20441
  }
20275
20442
  draw(ctx, size, x, y, z) {
20276
- const r = size / 2;
20443
+ const r = this.parseSize(size) / 2;
20277
20444
  return lineH(ctx, r, x, y);
20278
20445
  }
20279
20446
  drawOffset(ctx, size, x, y, offset, z) {
20280
- const r = size / 2 + offset;
20447
+ const r = this.parseSize(size) / 2 + offset;
20281
20448
  return lineH(ctx, r, x, y);
20282
20449
  }
20283
20450
  drawToSvgPath(size, x, y, z) {
20284
- const r = size / 2;
20451
+ const r = this.parseSize(size) / 2;
20285
20452
  return `M ${x - r}, ${y} L ${x + r},${y}`;
20286
20453
  }
20287
20454
  }
@@ -20301,15 +20468,15 @@ class CloseSymbol extends BaseSymbol {
20301
20468
  this.pathStr = 'M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5';
20302
20469
  }
20303
20470
  draw(ctx, size, x, y, z) {
20304
- const r = size / 2;
20471
+ const r = this.parseSize(size) / 2;
20305
20472
  return close(ctx, r, x, y);
20306
20473
  }
20307
20474
  drawOffset(ctx, size, x, y, offset, z) {
20308
- const r = size / 2 + offset;
20475
+ const r = this.parseSize(size) / 2 + offset;
20309
20476
  return close(ctx, r, x, y);
20310
20477
  }
20311
20478
  drawToSvgPath(size, x, y, z) {
20312
- const r = size / 2;
20479
+ const r = this.parseSize(size) / 2;
20313
20480
  return `M ${x - r}, ${y - r} L ${x + r},${y + r} M ${x + r}, ${y - r} L ${x - r},${y + r}`;
20314
20481
  }
20315
20482
  }
@@ -20360,6 +20527,7 @@ class CustomSymbolClass {
20360
20527
  this.isSvg = isSvg;
20361
20528
  }
20362
20529
  drawOffset(ctx, size, x, y, offset, z, cb) {
20530
+ size = this.parseSize(size);
20363
20531
  if (this.isSvg) {
20364
20532
  if (!this.svgCache) {
20365
20533
  return false;
@@ -20375,9 +20543,14 @@ class CustomSymbolClass {
20375
20543
  return false;
20376
20544
  }
20377
20545
  draw(ctx, size, x, y, z, cb) {
20546
+ size = this.parseSize(size);
20378
20547
  return this.drawOffset(ctx, size, x, y, 0, z, cb);
20379
20548
  }
20549
+ parseSize(size) {
20550
+ return isNumber(size) ? size : Math.min(size[0], size[1]);
20551
+ }
20380
20552
  bounds(size, bounds) {
20553
+ size = this.parseSize(size);
20381
20554
  if (this.isSvg) {
20382
20555
  if (!this.svgCache) {
20383
20556
  return;
@@ -21397,7 +21570,8 @@ class Paragraph {
21397
21570
  left = 0;
21398
21571
  baseline = 0;
21399
21572
  }
21400
- if (this.character.stroke) {
21573
+ const { lineWidth = 1 } = this.character;
21574
+ if (this.character.stroke && lineWidth) {
21401
21575
  applyStrokeStyle(ctx, this.character);
21402
21576
  ctx.strokeText(text, left, baseline);
21403
21577
  }
@@ -24219,6 +24393,63 @@ class AutoRenderPlugin {
24219
24393
  }
24220
24394
  }
24221
24395
 
24396
+ class AutoRefreshPlugin {
24397
+ constructor() {
24398
+ this.name = 'AutoRefreshPlugin';
24399
+ this.activeEvent = 'onRegister';
24400
+ this._uid = Generator.GenAutoIncrementId();
24401
+ this.key = this.name + this._uid;
24402
+ this.handleChange = (graphic) => {
24403
+ if (graphic.glyphHost) {
24404
+ graphic = graphic.glyphHost;
24405
+ }
24406
+ if (graphic.stage === this.pluginService.stage && graphic.stage != null) {
24407
+ graphic.stage.renderNextFrame();
24408
+ }
24409
+ };
24410
+ }
24411
+ activate(context) {
24412
+ this.pluginService = context;
24413
+ this.dpr = application.global.devicePixelRatio;
24414
+ this.refresh();
24415
+ }
24416
+ refresh() {
24417
+ if (!this._refreshByMediaQuery()) {
24418
+ this._refreshByRaf();
24419
+ }
24420
+ }
24421
+ _refreshByRaf() {
24422
+ const raf = application.global.getRequestAnimationFrame();
24423
+ this.rafId = raf(() => {
24424
+ if (application.global.devicePixelRatio !== this.dpr) {
24425
+ this.dpr = application.global.devicePixelRatio;
24426
+ this.pluginService.stage.setDpr(this.dpr, true);
24427
+ }
24428
+ this.refresh();
24429
+ });
24430
+ }
24431
+ _refreshByMediaQuery() {
24432
+ try {
24433
+ const mqString = `(resolution: ${window.devicePixelRatio}dppx)`;
24434
+ const updatePixelRatio = () => {
24435
+ if (window.devicePixelRatio !== this.dpr) {
24436
+ this.dpr = window.devicePixelRatio;
24437
+ this.pluginService.stage.setDpr(this.dpr, true);
24438
+ }
24439
+ };
24440
+ matchMedia(mqString).addEventListener('change', updatePixelRatio);
24441
+ }
24442
+ catch (err) {
24443
+ return false;
24444
+ }
24445
+ return true;
24446
+ }
24447
+ deactivate(context) {
24448
+ const craf = application.global.getCancelAnimationFrame();
24449
+ craf && this.rafId && craf(this.rafId);
24450
+ }
24451
+ }
24452
+
24222
24453
  class IncrementalAutoRenderPlugin {
24223
24454
  constructor() {
24224
24455
  this.name = 'IncrementalAutoRenderPlugin';
@@ -24497,6 +24728,7 @@ class Stage extends Group {
24497
24728
  constructor(params = {}) {
24498
24729
  var _a;
24499
24730
  super({});
24731
+ this.tickedBeforeRender = true;
24500
24732
  this._onVisibleChange = (visible) => {
24501
24733
  if (this._skipRender < 0) {
24502
24734
  return;
@@ -24523,6 +24755,15 @@ class Stage extends Group {
24523
24755
  this._afterRender && this._afterRender(stage);
24524
24756
  this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));
24525
24757
  this._afterNextRenderCbs = null;
24758
+ this.tickedBeforeRender = false;
24759
+ };
24760
+ this.afterTickCb = () => {
24761
+ var _a;
24762
+ this.tickedBeforeRender = true;
24763
+ if (((_a = this.params.optimize) === null || _a === void 0 ? void 0 : _a.tickRenderMode) === 'performance') ;
24764
+ else {
24765
+ this.state !== 'rendering' && this.render();
24766
+ }
24526
24767
  };
24527
24768
  this.params = params;
24528
24769
  this.theme = new Theme();
@@ -24561,6 +24802,9 @@ class Stage extends Group {
24561
24802
  if (params.autoRender) {
24562
24803
  this.enableAutoRender();
24563
24804
  }
24805
+ if (params.autoRefresh) {
24806
+ this.enableAutoRefresh();
24807
+ }
24564
24808
  if (params.disableDirtyBounds === false) {
24565
24809
  this.enableDirtyBounds();
24566
24810
  }
@@ -24587,6 +24831,7 @@ class Stage extends Group {
24587
24831
  if (params.background && isString(this._background) && this._background.includes('/')) {
24588
24832
  this.setAttributes({ background: this._background });
24589
24833
  }
24834
+ this.ticker.on('afterTick', this.afterTickCb);
24590
24835
  }
24591
24836
  pauseRender(sr = -1) {
24592
24837
  this._skipRender = sr;
@@ -24732,6 +24977,22 @@ class Stage extends Group {
24732
24977
  this.pluginService.unRegister(plugin);
24733
24978
  });
24734
24979
  }
24980
+ enableAutoRefresh() {
24981
+ if (this.autoRefresh) {
24982
+ return;
24983
+ }
24984
+ this.autoRefresh = true;
24985
+ this.pluginService.register(new AutoRefreshPlugin());
24986
+ }
24987
+ disableAutoRefresh() {
24988
+ if (!this.autoRefresh) {
24989
+ return;
24990
+ }
24991
+ this.autoRefresh = false;
24992
+ this.pluginService.findPluginsByName('AutoRefreshPlugin').forEach(plugin => {
24993
+ this.pluginService.unRegister(plugin);
24994
+ });
24995
+ }
24735
24996
  enableIncrementalAutoRender() {
24736
24997
  if (this.increaseAutoRender) {
24737
24998
  return;
@@ -24884,6 +25145,9 @@ class Stage extends Group {
24884
25145
  this.timeline.resume();
24885
25146
  const state = this.state;
24886
25147
  this.state = 'rendering';
25148
+ if (!this.tickedBeforeRender) {
25149
+ this.ticker.trySyncTickStatus();
25150
+ }
24887
25151
  this.layerService.prepareStageLayer(this);
24888
25152
  if (!this._skipRender) {
24889
25153
  this.lastRenderparams = params;
@@ -25081,6 +25345,7 @@ class Stage extends Group {
25081
25345
  }
25082
25346
  this.window.release();
25083
25347
  this.ticker.remTimeline(this.timeline);
25348
+ this.ticker.removeListener('afterTick', this.afterTickCb);
25084
25349
  this.renderService.renderTreeRoots = [];
25085
25350
  }
25086
25351
  setStage(stage) {
@@ -25193,25 +25458,6 @@ function createStage(params) {
25193
25458
  return new Stage(params);
25194
25459
  }
25195
25460
 
25196
- var params;
25197
- (function (params) {
25198
- params[params["W"] = 1] = "W";
25199
- params[params["H"] = 2] = "H";
25200
- params[params["WH"] = 3] = "WH";
25201
- })(params || (params = {}));
25202
-
25203
- const strCommandMap = [
25204
- 'arc',
25205
- 'arcTo',
25206
- 'bezierCurveTo',
25207
- 'closePath',
25208
- 'ellipse',
25209
- 'lineTo',
25210
- 'moveTo',
25211
- 'quadraticCurveTo',
25212
- 'rect'
25213
- ];
25214
-
25215
25461
  const initMatrix = new Matrix(1, 0, 0, 1, 0, 0);
25216
25462
  const globalPoint = { x: 0, y: 0 };
25217
25463
  let EmptyContext2d = class EmptyContext2d {
@@ -26143,56 +26389,12 @@ function simplifyRadialDist(points, sqTolerance) {
26143
26389
  }
26144
26390
  return newPoints;
26145
26391
  }
26146
- function simplifyDPStep(points, startIdx, endIdx, sqTolerance, simplified) {
26147
- let maxSqDist = sqTolerance;
26148
- let nextIdx = startIdx;
26149
- const startX = points[startIdx].x;
26150
- const startY = points[startIdx].y;
26151
- const endX = points[endIdx].x;
26152
- const endY = points[endIdx].y;
26153
- const vecX2 = endX - startX;
26154
- const vecY2 = endY - startY;
26155
- const sqLength = vecX2 * vecX2 + vecY2 * vecY2;
26156
- let area;
26157
- let sqArea;
26158
- let sqDistance;
26159
- let vecX1;
26160
- let vecY1;
26161
- for (let i = startIdx + 1, len = endIdx - 1; i < len; i++) {
26162
- vecX1 = points[i].x - startX;
26163
- vecY1 = points[i].y - startY;
26164
- area = vecX1 * vecY2 - vecX2 * vecY1;
26165
- sqArea = area * area;
26166
- sqDistance = sqArea / sqLength;
26167
- if (sqDistance > maxSqDist) {
26168
- maxSqDist = sqDistance;
26169
- nextIdx = i;
26170
- }
26171
- }
26172
- if (maxSqDist > sqTolerance) {
26173
- if (nextIdx - startIdx > 2) {
26174
- simplifyDPStep(points, startIdx, nextIdx, sqTolerance, simplified);
26175
- }
26176
- simplified.push(points[nextIdx], points[nextIdx + 1]);
26177
- if (endIdx - nextIdx > 2) {
26178
- simplifyDPStep(points, nextIdx, endIdx, sqTolerance, simplified);
26179
- }
26180
- }
26181
- }
26182
- function simplifyDouglasPeucker(points, sqTolerance) {
26183
- const lastIdx = points.length - 1;
26184
- const simplified = [points[0]];
26185
- simplifyDPStep(points, 0, lastIdx, sqTolerance, simplified);
26186
- simplified.push(points[lastIdx]);
26187
- return simplified;
26188
- }
26189
26392
  function flatten_simplify(points, tolerance, highestQuality) {
26190
26393
  if (points.length <= 10) {
26191
26394
  return points;
26192
26395
  }
26193
26396
  const sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;
26194
26397
  points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);
26195
- points = simplifyDouglasPeucker(points, sqTolerance);
26196
26398
  return points;
26197
26399
  }
26198
26400
 
@@ -28527,4 +28729,4 @@ const registerFlexLayoutPlugin = () => {
28527
28729
  Factory.registerPlugin('FlexLayoutPlugin', FlexLayoutPlugin);
28528
28730
  };
28529
28731
 
28530
- 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 };
28732
+ 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 };