@visactor/vrender-core 0.21.0-alpha.3 → 0.21.0-alpha.5

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 (238) 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/3d-interceptor.js +1 -2
  8. package/cjs/common/bounds-context.js +2 -1
  9. package/cjs/common/morphing-utils.js +1 -1
  10. package/cjs/common/path-svg.js +1 -1
  11. package/cjs/common/polygon.js +2 -2
  12. package/cjs/common/rect-utils.js +1 -1
  13. package/cjs/common/render-area.js +1 -1
  14. package/cjs/common/render-command-list.js +1 -2
  15. package/cjs/common/render-curve.js +1 -1
  16. package/cjs/common/render-utils.js +1 -1
  17. package/cjs/common/seg-context.js +1 -1
  18. package/cjs/common/simplify.js +1 -1
  19. package/cjs/common/sort.js +1 -1
  20. package/cjs/common/split-path.js +1 -1
  21. package/cjs/common/store.js +1 -1
  22. package/cjs/common/text.js.map +1 -1
  23. package/cjs/core/application.js +2 -1
  24. package/cjs/core/camera.js +1 -1
  25. package/cjs/core/constants.js +1 -1
  26. package/cjs/core/contributions/textMeasure/layout.js +1 -1
  27. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  28. package/cjs/core/core-modules.js +1 -1
  29. package/cjs/core/global-module.js +2 -0
  30. package/cjs/core/global.js +1 -1
  31. package/cjs/core/graphic-utils.js +1 -1
  32. package/cjs/core/index.js +1 -1
  33. package/cjs/core/layer-service.js +1 -1
  34. package/cjs/core/layer.js +1 -1
  35. package/cjs/core/light.js +1 -1
  36. package/cjs/core/stage.d.ts +2 -0
  37. package/cjs/core/stage.js +10 -6
  38. package/cjs/core/stage.js.map +1 -1
  39. package/cjs/core/window.js +1 -1
  40. package/cjs/graphic/builtin-symbol/arrow.js +2 -2
  41. package/cjs/graphic/builtin-symbol/arrow.js.map +1 -1
  42. package/cjs/graphic/builtin-symbol/arrow2-down.js +2 -2
  43. package/cjs/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  44. package/cjs/graphic/builtin-symbol/arrow2-left.js +2 -2
  45. package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  46. package/cjs/graphic/builtin-symbol/arrow2-right.js +2 -2
  47. package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  48. package/cjs/graphic/builtin-symbol/arrow2-up.js +2 -2
  49. package/cjs/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  50. package/cjs/graphic/builtin-symbol/base.d.ts +1 -0
  51. package/cjs/graphic/builtin-symbol/base.js +3 -0
  52. package/cjs/graphic/builtin-symbol/base.js.map +1 -1
  53. package/cjs/graphic/builtin-symbol/circle.js +3 -3
  54. package/cjs/graphic/builtin-symbol/circle.js.map +1 -1
  55. package/cjs/graphic/builtin-symbol/close.js +3 -3
  56. package/cjs/graphic/builtin-symbol/close.js.map +1 -1
  57. package/cjs/graphic/builtin-symbol/cross.js +2 -2
  58. package/cjs/graphic/builtin-symbol/cross.js.map +1 -1
  59. package/cjs/graphic/builtin-symbol/diamond.js +3 -3
  60. package/cjs/graphic/builtin-symbol/diamond.js.map +1 -1
  61. package/cjs/graphic/builtin-symbol/line-h.js +3 -3
  62. package/cjs/graphic/builtin-symbol/line-h.js.map +1 -1
  63. package/cjs/graphic/builtin-symbol/line-v.js +3 -3
  64. package/cjs/graphic/builtin-symbol/line-v.js.map +1 -1
  65. package/cjs/graphic/builtin-symbol/square.js +2 -2
  66. package/cjs/graphic/builtin-symbol/square.js.map +1 -1
  67. package/cjs/graphic/builtin-symbol/star.js +2 -2
  68. package/cjs/graphic/builtin-symbol/star.js.map +1 -1
  69. package/cjs/graphic/builtin-symbol/stroke.js +2 -2
  70. package/cjs/graphic/builtin-symbol/stroke.js.map +1 -1
  71. package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -2
  72. package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  73. package/cjs/graphic/builtin-symbol/triangle-down.js +2 -2
  74. package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
  75. package/cjs/graphic/builtin-symbol/triangle-left.js +2 -2
  76. package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
  77. package/cjs/graphic/builtin-symbol/triangle-right.js +2 -2
  78. package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
  79. package/cjs/graphic/builtin-symbol/triangle-up.js +2 -2
  80. package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
  81. package/cjs/graphic/builtin-symbol/utils.d.ts +1 -0
  82. package/cjs/graphic/builtin-symbol/utils.js +6 -3
  83. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  84. package/cjs/graphic/builtin-symbol/wedge.js +2 -2
  85. package/cjs/graphic/builtin-symbol/wedge.js.map +1 -1
  86. package/cjs/graphic/builtin-symbol/wye.js +2 -2
  87. package/cjs/graphic/builtin-symbol/wye.js.map +1 -1
  88. package/cjs/graphic/config.js +2 -1
  89. package/cjs/graphic/config.js.map +1 -1
  90. package/cjs/graphic/richtext/paragraph.js +3 -1
  91. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  92. package/cjs/graphic/text.js +10 -7
  93. package/cjs/graphic/text.js.map +1 -1
  94. package/cjs/interface/animate.d.ts +3 -1
  95. package/cjs/interface/animate.js.map +1 -1
  96. package/cjs/interface/context.d.ts +1 -0
  97. package/cjs/interface/context.js.map +1 -1
  98. package/cjs/interface/graphic/text.js.map +1 -1
  99. package/cjs/interface/graphic.d.ts +1 -0
  100. package/cjs/interface/graphic.js.map +1 -1
  101. package/cjs/interface/stage.d.ts +1 -0
  102. package/cjs/interface/stage.js.map +1 -1
  103. package/cjs/interface/text.d.ts +1 -0
  104. package/cjs/interface/text.js.map +1 -1
  105. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  106. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  107. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  108. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  109. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  110. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  111. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  112. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  113. package/cjs/render/contributions/render/text-render.d.ts +1 -1
  114. package/cjs/render/contributions/render/text-render.js +23 -23
  115. package/cjs/render/contributions/render/text-render.js.map +1 -1
  116. package/dist/index.es.js +145 -92
  117. package/es/animate/Ticker/default-ticker.d.ts +4 -2
  118. package/es/animate/Ticker/default-ticker.js +9 -6
  119. package/es/animate/Ticker/default-ticker.js.map +1 -1
  120. package/es/animate/custom-animate.d.ts +2 -0
  121. package/es/animate/custom-animate.js +11 -2
  122. package/es/animate/custom-animate.js.map +1 -1
  123. package/es/common/3d-interceptor.js +1 -2
  124. package/es/common/bounds-context.js +2 -1
  125. package/es/common/morphing-utils.js +1 -1
  126. package/es/common/path-svg.js +1 -1
  127. package/es/common/polygon.js +1 -1
  128. package/es/common/rect-utils.js +1 -1
  129. package/es/common/render-area.js +1 -1
  130. package/es/common/render-command-list.js +1 -2
  131. package/es/common/render-curve.js +1 -1
  132. package/es/common/render-utils.js +1 -1
  133. package/es/common/seg-context.js +1 -1
  134. package/es/common/simplify.js +1 -1
  135. package/es/common/sort.js +1 -1
  136. package/es/common/split-path.js +1 -1
  137. package/es/common/store.js +1 -1
  138. package/es/common/text.js.map +1 -1
  139. package/es/core/application.js +2 -1
  140. package/es/core/camera.js +1 -1
  141. package/es/core/constants.js +1 -1
  142. package/es/core/contributions/textMeasure/layout.js +1 -1
  143. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  144. package/es/core/core-modules.js +1 -1
  145. package/es/core/global-module.js +2 -0
  146. package/es/core/global.js +1 -1
  147. package/es/core/graphic-utils.js +1 -1
  148. package/es/core/index.js +1 -1
  149. package/es/core/layer-service.js +1 -1
  150. package/es/core/layer.js +1 -1
  151. package/es/core/light.js +1 -1
  152. package/es/core/stage.d.ts +2 -0
  153. package/es/core/stage.js +10 -6
  154. package/es/core/stage.js.map +1 -1
  155. package/es/core/window.js +1 -1
  156. package/es/graphic/builtin-symbol/arrow.js +2 -2
  157. package/es/graphic/builtin-symbol/arrow.js.map +1 -1
  158. package/es/graphic/builtin-symbol/arrow2-down.js +2 -2
  159. package/es/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  160. package/es/graphic/builtin-symbol/arrow2-left.js +2 -2
  161. package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  162. package/es/graphic/builtin-symbol/arrow2-right.js +2 -2
  163. package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  164. package/es/graphic/builtin-symbol/arrow2-up.js +2 -2
  165. package/es/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  166. package/es/graphic/builtin-symbol/base.d.ts +1 -0
  167. package/es/graphic/builtin-symbol/base.js +3 -0
  168. package/es/graphic/builtin-symbol/base.js.map +1 -1
  169. package/es/graphic/builtin-symbol/circle.js +3 -3
  170. package/es/graphic/builtin-symbol/circle.js.map +1 -1
  171. package/es/graphic/builtin-symbol/close.js +3 -3
  172. package/es/graphic/builtin-symbol/close.js.map +1 -1
  173. package/es/graphic/builtin-symbol/cross.js +2 -2
  174. package/es/graphic/builtin-symbol/cross.js.map +1 -1
  175. package/es/graphic/builtin-symbol/diamond.js +3 -3
  176. package/es/graphic/builtin-symbol/diamond.js.map +1 -1
  177. package/es/graphic/builtin-symbol/line-h.js +3 -3
  178. package/es/graphic/builtin-symbol/line-h.js.map +1 -1
  179. package/es/graphic/builtin-symbol/line-v.js +3 -3
  180. package/es/graphic/builtin-symbol/line-v.js.map +1 -1
  181. package/es/graphic/builtin-symbol/square.js +2 -2
  182. package/es/graphic/builtin-symbol/square.js.map +1 -1
  183. package/es/graphic/builtin-symbol/star.js +2 -2
  184. package/es/graphic/builtin-symbol/star.js.map +1 -1
  185. package/es/graphic/builtin-symbol/stroke.js +2 -2
  186. package/es/graphic/builtin-symbol/stroke.js.map +1 -1
  187. package/es/graphic/builtin-symbol/thin-triangle.js +2 -2
  188. package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  189. package/es/graphic/builtin-symbol/triangle-down.js +2 -2
  190. package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
  191. package/es/graphic/builtin-symbol/triangle-left.js +2 -2
  192. package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
  193. package/es/graphic/builtin-symbol/triangle-right.js +2 -2
  194. package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
  195. package/es/graphic/builtin-symbol/triangle-up.js +2 -2
  196. package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
  197. package/es/graphic/builtin-symbol/utils.d.ts +1 -0
  198. package/es/graphic/builtin-symbol/utils.js +7 -4
  199. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  200. package/es/graphic/builtin-symbol/wedge.js +2 -2
  201. package/es/graphic/builtin-symbol/wedge.js.map +1 -1
  202. package/es/graphic/builtin-symbol/wye.js +2 -2
  203. package/es/graphic/builtin-symbol/wye.js.map +1 -1
  204. package/es/graphic/config.js +2 -1
  205. package/es/graphic/config.js.map +1 -1
  206. package/es/graphic/richtext/paragraph.js +4 -2
  207. package/es/graphic/richtext/paragraph.js.map +1 -1
  208. package/es/graphic/text.js +10 -7
  209. package/es/graphic/text.js.map +1 -1
  210. package/es/interface/animate.d.ts +3 -1
  211. package/es/interface/animate.js.map +1 -1
  212. package/es/interface/context.d.ts +1 -0
  213. package/es/interface/context.js.map +1 -1
  214. package/es/interface/graphic/text.js.map +1 -1
  215. package/es/interface/graphic.d.ts +1 -0
  216. package/es/interface/graphic.js.map +1 -1
  217. package/es/interface/stage.d.ts +1 -0
  218. package/es/interface/stage.js.map +1 -1
  219. package/es/interface/text.d.ts +1 -0
  220. package/es/interface/text.js.map +1 -1
  221. package/es/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  222. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  223. package/es/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  224. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  225. package/es/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  226. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  227. package/es/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  228. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  229. package/es/render/contributions/render/text-render.d.ts +1 -1
  230. package/es/render/contributions/render/text-render.js +22 -22
  231. package/es/render/contributions/render/text-render.js.map +1 -1
  232. package/package.json +4 -3
  233. package/cjs/graphic/text2.d.ts +0 -81
  234. package/cjs/graphic/text2.js +0 -288
  235. package/cjs/graphic/text2.js.map +0 -1
  236. package/es/graphic/text2.d.ts +0 -81
  237. package/es/graphic/text2.js +0 -293
  238. package/es/graphic/text2.js.map +0 -1
package/dist/index.es.js CHANGED
@@ -3056,7 +3056,7 @@ const DefaultConnectAttribute = {
3056
3056
  const DefaultDebugAttribute = {
3057
3057
  _debug_bounds: false
3058
3058
  };
3059
- const DefaultAttribute = Object.assign(Object.assign(Object.assign({ strokeSeg: null, renderable: true, pickable: true, shadowGraphic: undefined, childrenPickable: true, fillPickable: true, strokePickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, fillStrokeOrder: 0, renderStyle: 'default', pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true, shadowRootIdx: 1, globalZIndex: 1, globalCompositeOperation: '', overflow: 'hidden', shadowPickMode: 'graphic' }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
3059
+ 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);
3060
3060
  function addAttributeToPrototype(obj, c, keys) {
3061
3061
  keys.forEach(key => {
3062
3062
  c.prototype[key] = obj[key];
@@ -6963,7 +6963,7 @@ class TimeOutTickHandler {
6963
6963
  }
6964
6964
  }
6965
6965
 
6966
- class DefaultTicker {
6966
+ class DefaultTicker extends EventEmitter {
6967
6967
  set mode(m) {
6968
6968
  if (this._mode === m) {
6969
6969
  return;
@@ -6975,18 +6975,19 @@ class DefaultTicker {
6975
6975
  return this._mode;
6976
6976
  }
6977
6977
  constructor(timelines = []) {
6978
+ super();
6978
6979
  this.handleTick = (handler, params) => {
6979
6980
  const { once = false } = params !== null && params !== void 0 ? params : {};
6980
6981
  if (this.ifCanStop()) {
6981
6982
  this.stop();
6982
6983
  return;
6983
6984
  }
6984
- this._handlerTick(handler);
6985
+ this._handlerTick();
6985
6986
  if (!once) {
6986
6987
  handler.tick(this.interval, this.handleTick);
6987
6988
  }
6988
6989
  };
6989
- this._handlerTick = (handler) => {
6990
+ this._handlerTick = () => {
6990
6991
  const tickerHandler = this.tickerHandler;
6991
6992
  const time = tickerHandler.getTime();
6992
6993
  let delta = 0;
@@ -7001,6 +7002,7 @@ class DefaultTicker {
7001
7002
  this.timelines.forEach(t => {
7002
7003
  t.tick(delta);
7003
7004
  });
7005
+ this.emit('afterTick');
7004
7006
  };
7005
7007
  this.init();
7006
7008
  this.lastFrameTime = -1;
@@ -7140,6 +7142,11 @@ class DefaultTicker {
7140
7142
  this.setupTickHandler();
7141
7143
  this.lastFrameTime = -1;
7142
7144
  }
7145
+ trySyncTickStatus() {
7146
+ if (this.status === STATUS$1.RUNNING) {
7147
+ this._handlerTick();
7148
+ }
7149
+ }
7143
7150
  }
7144
7151
 
7145
7152
  class ManualTickHandler {
@@ -8960,6 +8967,11 @@ class TagPointsUpdate extends ACustomAnimate {
8960
8967
  this.clipRange =
8961
8968
  this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /
8962
8969
  this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension];
8970
+ if (this.clipRange === 1) {
8971
+ this.shrinkClipRange =
8972
+ this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /
8973
+ this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension];
8974
+ }
8963
8975
  if (!isValidNumber(this.clipRange)) {
8964
8976
  this.clipRange = 0;
8965
8977
  }
@@ -8999,6 +9011,12 @@ class TagPointsUpdate extends ACustomAnimate {
8999
9011
  return newPoint;
9000
9012
  });
9001
9013
  }
9014
+ onFirstRun() {
9015
+ const lastClipRange = this.target.attribute.clipRange;
9016
+ if (isValidNumber(lastClipRange * this.clipRange)) {
9017
+ this.clipRange *= lastClipRange;
9018
+ }
9019
+ }
9002
9020
  onUpdate(end, ratio, out) {
9003
9021
  this.points = this.points.map((point, index) => {
9004
9022
  const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
@@ -9006,6 +9024,17 @@ class TagPointsUpdate extends ACustomAnimate {
9006
9024
  return newPoint;
9007
9025
  });
9008
9026
  if (this.clipRange) {
9027
+ if (this.shrinkClipRange) {
9028
+ if (!end) {
9029
+ out.points = this.fromPoints;
9030
+ out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio;
9031
+ }
9032
+ else {
9033
+ out.points = this.toPoints;
9034
+ out.clipRange = 1;
9035
+ }
9036
+ return;
9037
+ }
9009
9038
  out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
9010
9039
  }
9011
9040
  if (this.segmentsCache && this.to.segments) {
@@ -15531,14 +15560,14 @@ class DefaultArcRenderContribution {
15531
15560
  if (!(doOuterBorder || doInnerBorder)) {
15532
15561
  return;
15533
15562
  }
15534
- 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;
15563
+ 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;
15535
15564
  let { innerRadius = arcAttribute.innerRadius, outerRadius = arcAttribute.outerRadius } = arc.attribute;
15536
15565
  outerRadius += outerPadding;
15537
15566
  innerRadius -= innerPadding;
15538
15567
  const renderBorder = (borderStyle, key) => {
15539
15568
  const doStroke = !!(borderStyle && borderStyle.stroke);
15540
15569
  const { distance = arcAttribute[key].distance } = borderStyle;
15541
- const d = getScaledStroke(context, distance, context.dpr);
15570
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15542
15571
  const deltaAngle = distance / outerRadius;
15543
15572
  const sign = key === 'outerBorder' ? 1 : -1;
15544
15573
  arc.setAttributes({
@@ -15583,11 +15612,11 @@ class DefaultCircleRenderContribution {
15583
15612
  if (!(doOuterBorder || doInnerBorder)) {
15584
15613
  return;
15585
15614
  }
15586
- 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;
15615
+ 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;
15587
15616
  const renderBorder = (borderStyle, key) => {
15588
15617
  const doStroke = !!(borderStyle && borderStyle.stroke);
15589
15618
  const { distance = circleAttribute[key].distance } = borderStyle;
15590
- const d = getScaledStroke(context, distance, context.dpr);
15619
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15591
15620
  const sign = key === 'outerBorder' ? 1 : -1;
15592
15621
  context.beginPath();
15593
15622
  context.arc(x, y, radius + sign * d, startAngle, endAngle);
@@ -15772,7 +15801,7 @@ class DefaultRectRenderContribution {
15772
15801
  if (!(doOuterBorder || doInnerBorder)) {
15773
15802
  return;
15774
15803
  }
15775
- 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;
15804
+ 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;
15776
15805
  let { width, height } = rect.attribute;
15777
15806
  width = (width !== null && width !== void 0 ? width : x1 - x) || 0;
15778
15807
  height = (height !== null && height !== void 0 ? height : y1 - y) || 0;
@@ -15780,7 +15809,7 @@ class DefaultRectRenderContribution {
15780
15809
  const doStroke = !!(borderStyle && borderStyle.stroke);
15781
15810
  const sign = key === 'outerBorder' ? -1 : 1;
15782
15811
  const { distance = rectAttribute[key].distance } = borderStyle;
15783
- const d = getScaledStroke(context, distance, context.dpr);
15812
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
15784
15813
  const nextX = x + sign * d;
15785
15814
  const nextY = y + sign * d;
15786
15815
  const dw = d * 2;
@@ -16020,11 +16049,11 @@ class DefaultSymbolRenderContribution {
16020
16049
  if (!(doOuterBorder || doInnerBorder)) {
16021
16050
  return;
16022
16051
  }
16023
- const { size = symbolAttribute.size, opacity = symbolAttribute.opacity, x: originX = symbolAttribute.x, y: originY = symbolAttribute.y, scaleX = symbolAttribute.scaleX, scaleY = symbolAttribute.scaleY } = symbol.attribute;
16052
+ 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;
16024
16053
  const renderBorder = (borderStyle, key) => {
16025
16054
  const doStroke = !!(borderStyle && borderStyle.stroke);
16026
16055
  const { distance = symbolAttribute[key].distance } = borderStyle;
16027
- const d = getScaledStroke(context, distance, context.dpr);
16056
+ const d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr);
16028
16057
  const sign = key === 'outerBorder' ? 1 : -1;
16029
16058
  context.beginPath();
16030
16059
  if (parsedPath.drawOffset(context, size, x, y, sign * d) === false) {
@@ -17913,13 +17942,7 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17913
17942
  var _a, _b, _c;
17914
17943
  const textAttribute = getTheme(text, params === null || params === void 0 ? void 0 : params.theme).text;
17915
17944
  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;
17916
- let { textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline } = text.attribute;
17917
- if (!verticalMode && direction === 'vertical') {
17918
- const t = textAlign;
17919
- textAlign = (_a = text.getBaselineMapAlign()[textBaseline]) !== null && _a !== void 0 ? _a : 'left';
17920
- textBaseline = (_b = text.getAlignMapBaseline()[t]) !== null && _b !== void 0 ? _b : 'top';
17921
- }
17922
- const lineHeight = (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) !== null && _c !== void 0 ? _c : fontSize;
17945
+ const lineHeight = (_a = calculateLineHeight(text.attribute.lineHeight, fontSize)) !== null && _a !== void 0 ? _a : fontSize;
17923
17946
  const data = this.valid(text, textAttribute, fillCb, strokeCb);
17924
17947
  if (!data) {
17925
17948
  return;
@@ -17958,7 +17981,6 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17958
17981
  else if (fVisible) {
17959
17982
  context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
17960
17983
  context.fillText(t, _x, _y, z);
17961
- this.drawUnderLine(underline, lineThrough, text, _x, _y, z, textAttribute, context);
17962
17984
  }
17963
17985
  }
17964
17986
  if (direction) {
@@ -17993,7 +18015,7 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
17993
18015
  context.setCommonStyle(text, text.attribute, originX - x, originY - y, textAttribute);
17994
18016
  multilineLayout.lines.forEach(line => {
17995
18017
  context.fillText(line.str, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y, z);
17996
- this.drawUnderLine(underline, lineThrough, text, (line.leftOffset || 0) + xOffset + x, (line.topOffset || 0) + yOffset + y - textDrawOffsetY('bottom', fontSize) - 0.05 * fontSize, z, textAttribute, context, {
18018
+ 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, {
17997
18019
  width: line.width
17998
18020
  });
17999
18021
  });
@@ -18001,6 +18023,12 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
18001
18023
  }
18002
18024
  }
18003
18025
  else {
18026
+ let { textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline } = text.attribute;
18027
+ if (!verticalMode) {
18028
+ const t = textAlign;
18029
+ textAlign = (_b = text.getBaselineMapAlign()[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
18030
+ textBaseline = (_c = text.getAlignMapBaseline()[t]) !== null && _c !== void 0 ? _c : 'top';
18031
+ }
18004
18032
  text.tryUpdateAABBBounds();
18005
18033
  const cache = text.cache;
18006
18034
  const { verticalList } = cache;
@@ -18052,37 +18080,32 @@ let DefaultCanvasTextRender = class DefaultCanvasTextRender extends BaseRender {
18052
18080
  const computed3dMatrix = !keepDirIn3d;
18053
18081
  this._draw(text, textAttribute, computed3dMatrix, drawContext, params);
18054
18082
  }
18055
- drawUnderLine(underline, lineThrough, text, x, y, z, textAttribute, context, multiOption) {
18083
+ drawUnderLine(underline, lineThrough, text, anchorX, anchorY, offsetUnderLineY, offsetThroughLineY, z, textAttribute, context, multiOption) {
18056
18084
  if (lineThrough + underline <= 0) {
18057
18085
  return;
18058
18086
  }
18059
- 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;
18087
+ const { textAlign = textAttribute.textAlign, fill = textAttribute.fill, opacity = textAttribute.opacity, underlineOffset = textAttribute.underlineOffset, underlineDash = textAttribute.underlineDash, fillOpacity = textAttribute.fillOpacity } = text.attribute;
18060
18088
  const isMulti = !isNil(multiOption);
18061
18089
  const w = isMulti ? multiOption.width : text.clipedWidth;
18062
18090
  const offsetX = isMulti ? 0 : textDrawOffsetX(textAlign, w);
18063
- const offsetY = textLayoutOffsetY(isMulti ? 'alphabetic' : textBaseline, fontSize, fontSize);
18064
18091
  const attribute = { lineWidth: 0, stroke: fill, opacity, strokeOpacity: fillOpacity };
18065
- let deltaY = isMulti ? -3 : 0;
18066
18092
  if (underline) {
18067
18093
  attribute.lineWidth = underline;
18068
- context.setStrokeStyle(text, attribute, x, y, textAttribute);
18094
+ context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute);
18069
18095
  underlineDash && context.setLineDash(underlineDash);
18070
18096
  context.beginPath();
18071
- const dy = y + offsetY + fontSize + underlineOffset + deltaY;
18072
- context.moveTo(x + offsetX, dy, z);
18073
- context.lineTo(x + offsetX + w, dy, z);
18097
+ const dy = anchorY + offsetUnderLineY + underlineOffset;
18098
+ context.moveTo(anchorX + offsetX, dy, z);
18099
+ context.lineTo(anchorX + offsetX + w, dy, z);
18074
18100
  context.stroke();
18075
18101
  }
18076
- if (isMulti) {
18077
- deltaY = -1;
18078
- }
18079
18102
  if (lineThrough) {
18080
18103
  attribute.lineWidth = lineThrough;
18081
- context.setStrokeStyle(text, attribute, x, y, textAttribute);
18104
+ context.setStrokeStyle(text, attribute, anchorX, anchorY, textAttribute);
18082
18105
  context.beginPath();
18083
- const dy = y + offsetY + fontSize / 2 + deltaY;
18084
- context.moveTo(x + offsetX, dy, z);
18085
- context.lineTo(x + offsetX + w, dy, z);
18106
+ const dy = anchorY + offsetThroughLineY;
18107
+ context.moveTo(anchorX + offsetX, dy, z);
18108
+ context.lineTo(anchorX + offsetX + w, dy, z);
18086
18109
  context.stroke();
18087
18110
  }
18088
18111
  }
@@ -19121,7 +19144,9 @@ class CanvasTextLayout {
19121
19144
  const metrics = this.textMeasure.measureTextPixelADscentAndWidth(lines[i], this.textOptions);
19122
19145
  width = Math.min(metrics.width, lineWidth);
19123
19146
  linesLayout.push({
19124
- str: this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
19147
+ str: metrics.width <= lineWidth
19148
+ ? lines[i].toString()
19149
+ : this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
19125
19150
  width,
19126
19151
  ascent: metrics.ascent,
19127
19152
  descent: metrics.descent
@@ -19360,8 +19385,7 @@ class Text extends Graphic {
19360
19385
  const textTheme = this.getGraphicTheme();
19361
19386
  const attribute = this.attribute;
19362
19387
  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, ignoreBuf = textTheme.ignoreBuf, lineWidth = textTheme.lineWidth, whiteSpace = textTheme.whiteSpace, suffixPosition = textTheme.suffixPosition } = attribute;
19363
- const buf = ignoreBuf ? 0 : 2;
19364
- const lineHeight = this.getLineHeight(attribute, textTheme) + buf;
19388
+ const lineHeight = this.getLineHeight(attribute, textTheme);
19365
19389
  if (whiteSpace === 'normal' || wrap) {
19366
19390
  return this.updateWrapAABBBounds(text);
19367
19391
  }
@@ -19389,8 +19413,7 @@ class Text extends Graphic {
19389
19413
  var _a, _b, _c;
19390
19414
  const textTheme = this.getGraphicTheme();
19391
19415
  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;
19392
- const buf = ignoreBuf ? 0 : 2;
19393
- const lineHeight = this.getLineHeight(this.attribute, textTheme) + buf;
19416
+ const lineHeight = this.getLineHeight(this.attribute, textTheme);
19394
19417
  if (!this.shouldUpdateShape() && ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.layoutData)) {
19395
19418
  const bbox = this.cache.layoutData.bbox;
19396
19419
  this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
@@ -19428,8 +19451,8 @@ class Text extends Graphic {
19428
19451
  });
19429
19452
  break;
19430
19453
  }
19431
- const clip = textMeasure.clipText(str, textOptions, maxLineWidth, wordBreak === 'break-word');
19432
- if (str !== '' && clip.str === '') {
19454
+ const clip = textMeasure.clipText(str, textOptions, maxLineWidth, wordBreak !== 'break-all', wordBreak === 'keep-all');
19455
+ if ((str !== '' && clip.str === '') || clip.wordBreaked) {
19433
19456
  if (ellipsis) {
19434
19457
  const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, false, suffixPosition);
19435
19458
  clip.str = (_b = clipEllipsis.str) !== null && _b !== void 0 ? _b : '';
@@ -19448,9 +19471,14 @@ class Text extends Graphic {
19448
19471
  ascent: matrics.ascent,
19449
19472
  descent: matrics.descent
19450
19473
  });
19474
+ let cutLength = clip.str.length;
19475
+ if (clip.wordBreaked && !(str !== '' && clip.str === '')) {
19476
+ needCut = true;
19477
+ cutLength = clip.wordBreaked;
19478
+ }
19451
19479
  if (clip.str.length === str.length) ;
19452
19480
  else if (needCut) {
19453
- const newStr = str.substring(clip.str.length);
19481
+ const newStr = str.substring(cutLength);
19454
19482
  lines.splice(i + 1, 0, newStr);
19455
19483
  }
19456
19484
  }
@@ -19785,6 +19813,9 @@ class BaseSymbol {
19785
19813
  bounds.y2 = size[1] / 2;
19786
19814
  }
19787
19815
  }
19816
+ parseSize(size) {
19817
+ return isNumber(size) ? size : Math.min(size[0], size[1]);
19818
+ }
19788
19819
  }
19789
19820
 
19790
19821
  function circle(ctx, r, x, y, z) {
@@ -19803,15 +19834,15 @@ class CircleSymbol extends BaseSymbol {
19803
19834
  this.pathStr = 'M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0';
19804
19835
  }
19805
19836
  draw(ctx, size, x, y, z) {
19806
- const r = size / 2;
19837
+ const r = this.parseSize(size) / 2;
19807
19838
  return circle(ctx, r, x, y, z);
19808
19839
  }
19809
19840
  drawOffset(ctx, size, x, y, offset, z) {
19810
- const r = size / 2 + offset;
19841
+ const r = this.parseSize(size) / 2 + offset;
19811
19842
  return circle(ctx, r, x, y, z);
19812
19843
  }
19813
19844
  drawToSvgPath(size, x, y, z) {
19814
- const r = size / 2;
19845
+ const r = this.parseSize(size) / 2;
19815
19846
  return `M ${x - r}, ${y} a ${r},${r} 0 1,0 ${r * 2},0 a ${r},${r} 0 1,0 -${r * 2},0`;
19816
19847
  }
19817
19848
  }
@@ -19856,11 +19887,11 @@ class CrossSymbol extends BaseSymbol {
19856
19887
  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';
19857
19888
  }
19858
19889
  draw(ctx, size, x, y, z) {
19859
- const r = size / 6;
19890
+ const r = this.parseSize(size) / 6;
19860
19891
  return cross(ctx, r, x, y, z);
19861
19892
  }
19862
19893
  drawOffset(ctx, size, x, y, offset, z) {
19863
- const r = size / 6;
19894
+ const r = this.parseSize(size) / 6;
19864
19895
  return crossOffset(ctx, r, x, y, offset, z);
19865
19896
  }
19866
19897
  }
@@ -19881,15 +19912,15 @@ class DiamondSymbol extends BaseSymbol {
19881
19912
  this.pathStr = 'M-0.5,0L0,-0.5L0.5,0L0,0.5Z';
19882
19913
  }
19883
19914
  draw(ctx, size, x, y, z) {
19884
- const r = size / 2;
19915
+ const r = this.parseSize(size) / 2;
19885
19916
  return diamond(ctx, r, x, y, z);
19886
19917
  }
19887
19918
  drawFitDir(ctx, size, x, y, z) {
19888
- const r = size / 2;
19919
+ const r = this.parseSize(size) / 2;
19889
19920
  return diamond(ctx, r, x, y, z);
19890
19921
  }
19891
19922
  drawOffset(ctx, size, x, y, offset, z) {
19892
- const r = size / 2 + offset;
19923
+ const r = this.parseSize(size) / 2 + offset;
19893
19924
  return diamond(ctx, r, x, y, z);
19894
19925
  }
19895
19926
  }
@@ -19907,11 +19938,11 @@ class SquareSymbol extends BaseSymbol {
19907
19938
  this.pathStr = 'M-0.5,-0.5h1v1h-1Z';
19908
19939
  }
19909
19940
  draw(ctx, size, x, y) {
19910
- const r = size / 2;
19941
+ const r = this.parseSize(size) / 2;
19911
19942
  return square(ctx, r, x, y);
19912
19943
  }
19913
19944
  drawOffset(ctx, size, x, y, offset) {
19914
- const r = size / 2 + offset;
19945
+ const r = this.parseSize(size) / 2 + offset;
19915
19946
  return square(ctx, r, x, y);
19916
19947
  }
19917
19948
  }
@@ -19931,11 +19962,11 @@ class TriangleUpSymbol extends BaseSymbol {
19931
19962
  this.pathStr = 'M0.5,0.5 L-0.5,0.5 L0,-0.5 Z';
19932
19963
  }
19933
19964
  draw(ctx, size, x, y) {
19934
- const r = size / 2;
19965
+ const r = this.parseSize(size) / 2;
19935
19966
  return trianglUpOffset(ctx, r, x, y);
19936
19967
  }
19937
19968
  drawOffset(ctx, size, x, y, offset) {
19938
- const r = size / 2;
19969
+ const r = this.parseSize(size) / 2;
19939
19970
  return trianglUpOffset(ctx, r, x, y, offset);
19940
19971
  }
19941
19972
  }
@@ -19974,11 +20005,11 @@ class StarSymbol extends BaseSymbol {
19974
20005
  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';
19975
20006
  }
19976
20007
  draw(ctx, size, transX, transY) {
19977
- const r = size / 2;
20008
+ const r = this.parseSize(size) / 2;
19978
20009
  return star(ctx, r, transX, transY);
19979
20010
  }
19980
20011
  drawOffset(ctx, size, transX, transY, offset) {
19981
- const r = size / 2 + offset;
20012
+ const r = this.parseSize(size) / 2 + offset;
19982
20013
  return star(ctx, r, transX, transY);
19983
20014
  }
19984
20015
  }
@@ -20007,11 +20038,11 @@ class ArrowSymbol extends BaseSymbol {
20007
20038
  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';
20008
20039
  }
20009
20040
  draw(ctx, size, transX, transY) {
20010
- const r = size / 2;
20041
+ const r = this.parseSize(size) / 2;
20011
20042
  return arrow(ctx, r, transX, transY);
20012
20043
  }
20013
20044
  drawOffset(ctx, size, transX, transY, offset) {
20014
- const r = size / 2 + offset;
20045
+ const r = this.parseSize(size) / 2 + offset;
20015
20046
  return arrow(ctx, r, transX, transY);
20016
20047
  }
20017
20048
  }
@@ -20032,11 +20063,11 @@ class WedgeSymbol extends BaseSymbol {
20032
20063
  this.pathStr = 'M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z';
20033
20064
  }
20034
20065
  draw(ctx, size, transX, transY) {
20035
- const r = size / 2;
20066
+ const r = this.parseSize(size) / 2;
20036
20067
  return wedge(ctx, r, transX, transY);
20037
20068
  }
20038
20069
  drawOffset(ctx, size, transX, transY, offset) {
20039
- const r = size / 2 + offset;
20070
+ const r = this.parseSize(size) / 2 + offset;
20040
20071
  return wedge(ctx, r, transX, transY);
20041
20072
  }
20042
20073
  }
@@ -20054,11 +20085,11 @@ class StrokeSymbol extends BaseSymbol {
20054
20085
  this.pathStr = '';
20055
20086
  }
20056
20087
  draw(ctx, size, transX, transY) {
20057
- const r = size / 2;
20088
+ const r = this.parseSize(size) / 2;
20058
20089
  return stroke(ctx, r, transX, transY);
20059
20090
  }
20060
20091
  drawOffset(ctx, size, transX, transY, offset) {
20061
- const r = size / 2 + offset;
20092
+ const r = this.parseSize(size) / 2 + offset;
20062
20093
  return stroke(ctx, r, transX, transY);
20063
20094
  }
20064
20095
  }
@@ -20093,11 +20124,11 @@ class WyeSymbol extends BaseSymbol {
20093
20124
  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';
20094
20125
  }
20095
20126
  draw(ctx, size, transX, transY) {
20096
- const r = size / 2;
20127
+ const r = this.parseSize(size) / 2;
20097
20128
  return wye(ctx, r, transX, transY);
20098
20129
  }
20099
20130
  drawOffset(ctx, size, transX, transY, offset) {
20100
- const r = size / 2 + offset;
20131
+ const r = this.parseSize(size) / 2 + offset;
20101
20132
  return wye(ctx, r, transX, transY);
20102
20133
  }
20103
20134
  }
@@ -20117,11 +20148,11 @@ class TriangleLeftSymbol extends BaseSymbol {
20117
20148
  this.pathStr = 'M-0.5,0 L0.5,0.5 L0.5,-0.5 Z';
20118
20149
  }
20119
20150
  draw(ctx, size, x, y) {
20120
- const r = size / 2;
20151
+ const r = this.parseSize(size) / 2;
20121
20152
  return trianglLeftOffset(ctx, r, x, y, 0);
20122
20153
  }
20123
20154
  drawOffset(ctx, size, x, y, offset) {
20124
- const r = size / 2;
20155
+ const r = this.parseSize(size) / 2;
20125
20156
  return trianglLeftOffset(ctx, r, x, y, offset);
20126
20157
  }
20127
20158
  }
@@ -20141,11 +20172,11 @@ class TriangleRightSymbol extends BaseSymbol {
20141
20172
  this.pathStr = 'M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z';
20142
20173
  }
20143
20174
  draw(ctx, size, x, y) {
20144
- const r = size / 2;
20175
+ const r = this.parseSize(size) / 2;
20145
20176
  return trianglRightOffset(ctx, r, x, y);
20146
20177
  }
20147
20178
  drawOffset(ctx, size, x, y, offset) {
20148
- const r = size / 2;
20179
+ const r = this.parseSize(size) / 2;
20149
20180
  return trianglRightOffset(ctx, r, x, y, offset);
20150
20181
  }
20151
20182
  }
@@ -20165,11 +20196,11 @@ class TriangleDownSymbol extends BaseSymbol {
20165
20196
  this.pathStr = 'M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z';
20166
20197
  }
20167
20198
  draw(ctx, size, x, y) {
20168
- const r = size / 2;
20199
+ const r = this.parseSize(size) / 2;
20169
20200
  return trianglDownOffset(ctx, r, x, y);
20170
20201
  }
20171
20202
  drawOffset(ctx, size, x, y, offset) {
20172
- const r = size / 2;
20203
+ const r = this.parseSize(size) / 2;
20173
20204
  return trianglDownOffset(ctx, r, x, y, offset);
20174
20205
  }
20175
20206
  }
@@ -20191,11 +20222,11 @@ class ThinTriangleSymbol extends BaseSymbol {
20191
20222
  this.pathStr = 'M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z';
20192
20223
  }
20193
20224
  draw(ctx, size, x, y) {
20194
- const r = size / 2 / sqrt3;
20225
+ const r = this.parseSize(size) / 2 / sqrt3;
20195
20226
  return thinTriangle(ctx, r, x, y);
20196
20227
  }
20197
20228
  drawOffset(ctx, size, x, y, offset) {
20198
- const r = size / 2 / sqrt3 + offset;
20229
+ const r = this.parseSize(size) / 2 / sqrt3 + offset;
20199
20230
  return thinTriangle(ctx, r, x, y);
20200
20231
  }
20201
20232
  }
@@ -20215,11 +20246,11 @@ class Arrow2LeftSymbol extends BaseSymbol {
20215
20246
  this.pathStr = 'M 0.25 -0.5 L -0.25 0 l 0.25 0.5';
20216
20247
  }
20217
20248
  draw(ctx, size, transX, transY) {
20218
- const r = size / 4;
20249
+ const r = this.parseSize(size) / 4;
20219
20250
  return arrow2Left(ctx, r, transX, transY);
20220
20251
  }
20221
20252
  drawOffset(ctx, size, transX, transY, offset) {
20222
- const r = size / 4 + offset;
20253
+ const r = this.parseSize(size) / 4 + offset;
20223
20254
  return arrow2Left(ctx, r, transX, transY);
20224
20255
  }
20225
20256
  }
@@ -20239,11 +20270,11 @@ class Arrow2RightSymbol extends BaseSymbol {
20239
20270
  this.pathStr = 'M -0.25 -0.5 l 0.25 0 l -0.25 0.5';
20240
20271
  }
20241
20272
  draw(ctx, size, transX, transY) {
20242
- const r = size / 4;
20273
+ const r = this.parseSize(size) / 4;
20243
20274
  return arrow2Right(ctx, r, transX, transY);
20244
20275
  }
20245
20276
  drawOffset(ctx, size, transX, transY, offset) {
20246
- const r = size / 4 + offset;
20277
+ const r = this.parseSize(size) / 4 + offset;
20247
20278
  return arrow2Right(ctx, r, transX, transY);
20248
20279
  }
20249
20280
  }
@@ -20263,11 +20294,11 @@ class Arrow2UpSymbol extends BaseSymbol {
20263
20294
  this.pathStr = 'M -0.5 0.25 L 0 -0.25 l 0.5 0.25';
20264
20295
  }
20265
20296
  draw(ctx, size, transX, transY) {
20266
- const r = size / 4;
20297
+ const r = this.parseSize(size) / 4;
20267
20298
  return arrow2Up(ctx, r, transX, transY);
20268
20299
  }
20269
20300
  drawOffset(ctx, size, transX, transY, offset) {
20270
- const r = size / 4 + offset;
20301
+ const r = this.parseSize(size) / 4 + offset;
20271
20302
  return arrow2Up(ctx, r, transX, transY);
20272
20303
  }
20273
20304
  }
@@ -20287,11 +20318,11 @@ class Arrow2DownSymbol extends BaseSymbol {
20287
20318
  this.pathStr = 'M -0.5 -0.25 L 0 0.25 l 0.5 -0.25';
20288
20319
  }
20289
20320
  draw(ctx, size, transX, transY) {
20290
- const r = size / 4;
20321
+ const r = this.parseSize(size) / 4;
20291
20322
  return arrow2Down(ctx, r, transX, transY);
20292
20323
  }
20293
20324
  drawOffset(ctx, size, transX, transY, offset) {
20294
- const r = size / 4 + offset;
20325
+ const r = this.parseSize(size) / 4 + offset;
20295
20326
  return arrow2Down(ctx, r, transX, transY);
20296
20327
  }
20297
20328
  }
@@ -20309,15 +20340,15 @@ class LineVSymbol extends BaseSymbol {
20309
20340
  this.pathStr = 'M0,-0.5L0,0.5';
20310
20341
  }
20311
20342
  draw(ctx, size, x, y, z) {
20312
- const r = size / 2;
20343
+ const r = this.parseSize(size) / 2;
20313
20344
  return lineV(ctx, r, x, y);
20314
20345
  }
20315
20346
  drawOffset(ctx, size, x, y, offset, z) {
20316
- const r = size / 2 + offset;
20347
+ const r = this.parseSize(size) / 2 + offset;
20317
20348
  return lineV(ctx, r, x, y);
20318
20349
  }
20319
20350
  drawToSvgPath(size, x, y, z) {
20320
- const r = size / 2;
20351
+ const r = this.parseSize(size) / 2;
20321
20352
  return `M ${x}, ${y - r} L ${x},${y + r}`;
20322
20353
  }
20323
20354
  }
@@ -20335,15 +20366,15 @@ class LineHSymbol extends BaseSymbol {
20335
20366
  this.pathStr = 'M-0.5,0L0.5,0';
20336
20367
  }
20337
20368
  draw(ctx, size, x, y, z) {
20338
- const r = size / 2;
20369
+ const r = this.parseSize(size) / 2;
20339
20370
  return lineH(ctx, r, x, y);
20340
20371
  }
20341
20372
  drawOffset(ctx, size, x, y, offset, z) {
20342
- const r = size / 2 + offset;
20373
+ const r = this.parseSize(size) / 2 + offset;
20343
20374
  return lineH(ctx, r, x, y);
20344
20375
  }
20345
20376
  drawToSvgPath(size, x, y, z) {
20346
- const r = size / 2;
20377
+ const r = this.parseSize(size) / 2;
20347
20378
  return `M ${x - r}, ${y} L ${x + r},${y}`;
20348
20379
  }
20349
20380
  }
@@ -20363,15 +20394,15 @@ class CloseSymbol extends BaseSymbol {
20363
20394
  this.pathStr = 'M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5';
20364
20395
  }
20365
20396
  draw(ctx, size, x, y, z) {
20366
- const r = size / 2;
20397
+ const r = this.parseSize(size) / 2;
20367
20398
  return close(ctx, r, x, y);
20368
20399
  }
20369
20400
  drawOffset(ctx, size, x, y, offset, z) {
20370
- const r = size / 2 + offset;
20401
+ const r = this.parseSize(size) / 2 + offset;
20371
20402
  return close(ctx, r, x, y);
20372
20403
  }
20373
20404
  drawToSvgPath(size, x, y, z) {
20374
- const r = size / 2;
20405
+ const r = this.parseSize(size) / 2;
20375
20406
  return `M ${x - r}, ${y - r} L ${x + r},${y + r} M ${x + r}, ${y - r} L ${x - r},${y + r}`;
20376
20407
  }
20377
20408
  }
@@ -20422,6 +20453,7 @@ class CustomSymbolClass {
20422
20453
  this.isSvg = isSvg;
20423
20454
  }
20424
20455
  drawOffset(ctx, size, x, y, offset, z, cb) {
20456
+ size = this.parseSize(size);
20425
20457
  if (this.isSvg) {
20426
20458
  if (!this.svgCache) {
20427
20459
  return false;
@@ -20437,9 +20469,14 @@ class CustomSymbolClass {
20437
20469
  return false;
20438
20470
  }
20439
20471
  draw(ctx, size, x, y, z, cb) {
20472
+ size = this.parseSize(size);
20440
20473
  return this.drawOffset(ctx, size, x, y, 0, z, cb);
20441
20474
  }
20475
+ parseSize(size) {
20476
+ return isNumber(size) ? size : Math.min(size[0], size[1]);
20477
+ }
20442
20478
  bounds(size, bounds) {
20479
+ size = this.parseSize(size);
20443
20480
  if (this.isSvg) {
20444
20481
  if (!this.svgCache) {
20445
20482
  return;
@@ -21459,7 +21496,8 @@ class Paragraph {
21459
21496
  left = 0;
21460
21497
  baseline = 0;
21461
21498
  }
21462
- if (this.character.stroke) {
21499
+ const { lineWidth = 1 } = this.character;
21500
+ if (this.character.stroke && lineWidth) {
21463
21501
  applyStrokeStyle(ctx, this.character);
21464
21502
  ctx.strokeText(text, left, baseline);
21465
21503
  }
@@ -24616,6 +24654,7 @@ class Stage extends Group {
24616
24654
  constructor(params = {}) {
24617
24655
  var _a;
24618
24656
  super({});
24657
+ this.tickedBeforeRender = true;
24619
24658
  this._onVisibleChange = (visible) => {
24620
24659
  if (this._skipRender < 0) {
24621
24660
  return;
@@ -24642,6 +24681,15 @@ class Stage extends Group {
24642
24681
  this._afterRender && this._afterRender(stage);
24643
24682
  this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));
24644
24683
  this._afterNextRenderCbs = null;
24684
+ this.tickedBeforeRender = false;
24685
+ };
24686
+ this.afterTickCb = () => {
24687
+ var _a;
24688
+ this.tickedBeforeRender = true;
24689
+ if (((_a = this.params.optimize) === null || _a === void 0 ? void 0 : _a.tickRenderMode) === 'performance') ;
24690
+ else {
24691
+ this.state !== 'rendering' && this.render();
24692
+ }
24645
24693
  };
24646
24694
  this.params = params;
24647
24695
  this.theme = new Theme();
@@ -24709,6 +24757,7 @@ class Stage extends Group {
24709
24757
  if (params.background && isString(this._background) && this._background.includes('/')) {
24710
24758
  this.setAttributes({ background: this._background });
24711
24759
  }
24760
+ this.ticker.on('afterTick', this.afterTickCb);
24712
24761
  }
24713
24762
  pauseRender(sr = -1) {
24714
24763
  this._skipRender = sr;
@@ -25022,6 +25071,9 @@ class Stage extends Group {
25022
25071
  this.timeline.resume();
25023
25072
  const state = this.state;
25024
25073
  this.state = 'rendering';
25074
+ if (!this.tickedBeforeRender) {
25075
+ this.ticker.trySyncTickStatus();
25076
+ }
25025
25077
  this.layerService.prepareStageLayer(this);
25026
25078
  if (!this._skipRender) {
25027
25079
  this.lastRenderparams = params;
@@ -25219,6 +25271,7 @@ class Stage extends Group {
25219
25271
  }
25220
25272
  this.window.release();
25221
25273
  this.ticker.remTimeline(this.timeline);
25274
+ this.ticker.removeListener('afterTick', this.afterTickCb);
25222
25275
  this.renderService.renderTreeRoots = [];
25223
25276
  }
25224
25277
  setStage(stage) {